Code Monkey home page Code Monkey logo

telegraph-image-downloader's Introduction

Hi there ๐Ÿ‘‹ I'm Artyom

๐ŸŽ“ I'm a CS student at the Kuban State University :)

โšก Interested in coding, AI, web design, gaming, music, anime/manga.

๐Ÿ˜ธ Cats are my favorite animals :3

๐Ÿ‘จโ€๐Ÿ’ป Programming skills: C++, C#, WinForms, Python, PyQt, HTML, CSS, JS.

๐Ÿ’ป Other: Adobe Photoshop, Premiere Pro, After Effects, AutoCAD, Linux, Google Colab, etc.

๐Ÿ“™ Learning / will learn: Node.js, Flutter, OpenGL, AI stuff (e.g., pytorch).

Contacts

Website: soon

Steam: https://steamcommunity.com/id/artez0n

VK: https://vk.com/artez0n

telegraph-image-downloader's People

Contributors

artezon avatar lgc2333 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telegraph-image-downloader's Issues

If links contains word in another language will fail

Hi, the is a great software that able to download all the pictures from telegraph link.
Unfortunately if I provide a link that contains word in another language like chinese and it will fail
Any workarounds?
Thank you very much!!
image
the word in chinese cannot be pasted properly (may be the issue)

Syntax Error: Non-ASCII character - PEP-0263 launching script on Raspbian

Hello
i tried to launche .py script on Raspberry PI 2B but i get:

File "download.py", line 115 SyntaxError: Non-ASCII character '\xe2' in file download.py on line 115, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Reading the link i added on the top of py file all the coding lines in the examples (one by one). But , for example, with utf-8 i get this error:

File "download.py", line 137 if this_failed == 0: print(f' Downloading... {percent}%', end='\r', flush=True) ^ SyntaxError: invalid syntax

Fixes for 2 bugs

Hello, my friend faced today a bug in a script and asked for fix, I helped him to solve it and come back to this repo to report.

Bug that he encounter related to wrongly detected encoding of html, he got crash when he tried to get title with regex, see this line.

For that fix I changed line to check regex match first and exit from program if it = None
Just add a check before calling .group because re.search result either re.Match or None.

Secondly I diminished bug that related to encoding isssue, for that I use https://pypi.org/project/charset-normalizer/ library.
I imported from charset_normalizer import from_bytes and changed code in line 132 into:

                encoding_fix = str(from_bytes(requests.get(url).content).best())
                html = list(str(bs(encoding_fix, features='html.parser')).split('\n'))

But it's not ideal code, since in very rare case .best() may produce None too if encoding is too weird, but that occurrence is < 0.5%. While charset-normalizer is best python lib for encoding guessing it also can fail sometimes. At least I encounter it for myself when tried to detect file names within eastern zip archives.

Image link to googleusercontent.com not downloaded

Hello
There is a link on telegra.ph with images linked to lh3.googleusercontent.com google storage and your script went in error when try to download image. But if i copy/paste the link into browser it show the image perfectly.

Here you are one of that links not downloaded:
https://lh5.googleusercontent.com/6ZVrJWQlQ5JieOpMfPtGNPER0o17NOyyNfwth7U9rge6GT3zdo6iWzzbqw0eqISAfPF6Cyj093Pz_Y_qnTogtRueHmHG85H_YAlJxz_pM-Ifnoh4JZuIJ5xxJzqJbh7Vk0RrhntD

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.