Giter Site home page Giter Site logo

dl-telegram-by-file-attachment's Introduction

DL-Telegram-by-file-attachment

License

Abandoned, looking for contributors as I am not using it anymore. Check https://github.com/Dineshkarthik/telegram_media_downloader.

This tool automatically download a file (document) from a Telegram channel based on terms to search on.

The service used to get Telegram content has a RPM limit of 15 requests per minute but the script can check if the file is already present and not download it again.

Installation & Use

Make sure to have Python3 installed on your system: you can follow the instruction to get it straight from the Python website.

Clone this repository and rename config-sample.ini to config.ini then open the renamed file and change the configuration as you wish.

The parameters you can set are:

  • name is the channel name you want to download from (only the name, not the whole URL)
  • pages is the number of pages to search for documents to download
  • filter allows you to filter the file type to download
  • download is the folder where the downloads are stored

To use the tool simply run downloader.py.

dl-telegram-by-file-attachment's People

Contributors

edmael avatar gmellini avatar mte90 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

Watchers

 avatar  avatar

dl-telegram-by-file-attachment's Issues

Filters for specific files

Hello and first let me say thanks for this. I was wondering if it is possible to use filters to match certain files/titles. Could you explain how i could use this to monitor a channel and auto download all files titled "free.pdf"

I presume i could just set this to run on cron or something.

Thanks

Private channels

Can you implement api_id / api_hash, so its possible to download from private channels?

doesn't work, can you help me?

Traceback (most recent call last):
  File ".\downloader.py", line 35, in <module>
    r = urlopen(url)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 543, in _open
    '_open', req)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 1362, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 1319, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\http\client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\http\client.py", line 1263, in _send_request
    self.putrequest(method, url, **skips)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\http\client.py", line 1114, in putrequest
    self._validate_path(url)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\http\client.py", line 1205, in _validate_path
    raise InvalidURL(f"URL can't contain control characters. {url!r} "
http.client.InvalidURL: URL can't contain control characters. '/json/"libros calidad™📚3.0"/1?limit=100' (found at least ' ')```

Improve project readme

Sorry to post here but
can you explain how to use it?
thank you

where to put the files etc.

Error in some channels

When downloading on some channels, some files are downloaded but then this error shows up and it stops. Further attempts always the same.

Traceback (most recent call last):
File "C:\tools\winpython\WPy32-3920\tools\DL-Telegram-by-file-attachment\downloader.py", line 44, in
if 'document' in message['media'] and re.search(term, message['media']['document']['attributes'][0]['file_name'], re.IGNORECASE):
KeyError: 'file_name'

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.