Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk download images #1382

Open
amiremami opened this Issue Dec 12, 2015 · 14 comments

Comments

Projects
None yet
@amiremami
Copy link

amiremami commented Dec 12, 2015

For example my friend upload and send me 10 pictures to me. Please provide an option to download all of them together, not one by one.

@auchri auchri changed the title [Feature Request][Desktop] Bulk Download Images Bulk Download Images Dec 13, 2015

@auchri auchri changed the title Bulk Download Images Bulk download Images Dec 13, 2015

@auchri auchri changed the title Bulk download Images Bulk download images Dec 13, 2015

@auchri auchri added the enhancement label Dec 13, 2015

@auchri auchri modified the milestone: Next version Dec 29, 2015

@amiremami

This comment has been minimized.

Copy link
Author

amiremami commented Mar 4, 2016

@auchri is it possible to add this feature? Takes so much time to download one by one.

@Aokromes

This comment has been minimized.

Copy link

Aokromes commented Apr 20, 2016

#809 ?

@auchri

This comment has been minimized.

Copy link
Member

auchri commented Apr 20, 2016

@Aokromes it's related to #809, but it's not the same.

@amiremami

This comment has been minimized.

Copy link
Author

amiremami commented Jun 22, 2016

My sister sent me 100 photos from the trip we went and I wasn't able to download the images one by one! So she emailed me. Here is a real situation when telegram lacks this feature.

@MasterGroosha

This comment has been minimized.

Copy link

MasterGroosha commented Mar 2, 2017

@amiremami I know this is a dumb workaround, but:

  1. Set "Default download path" to the folder you want your photos to be downloaded.
  2. Open the most recent photo in a batch.
  3. Hover mouse over "Download" icon.
  4. Now repedeately press "Left" (or "Right", I don't remember) on keyboard and click left mouse button.

This is the fastest (IMO) method (~2 photos per second) to bulk download images.
Or setup an IFTTT integration...

@amiremami

This comment has been minimized.

Copy link
Author

amiremami commented Mar 2, 2017

Hey @MasterGroosha thanks a lot for this trick. Yeah it works, or we can use gmail for sending images, much more easier!

Hope Telegram adds this feature 😞

@Speeddymon

This comment has been minimized.

Copy link

Speeddymon commented Jul 3, 2017

Upvote from me. Android has an option to auto save all images to gallery, but that feature is missing on Windows (PC) version. Would like to be able to auto save all images on PC so that I can avoid filling up my sd card, as I have a 36 terabyte NAS server which I can save images to instead.

@pedrogarcia

This comment has been minimized.

Copy link

pedrogarcia commented Sep 12, 2017

I thought it already was possible, was surprised it was not.
Ideally, what I would like to do is to select a few pictures/messages and right click > save image as...
Saving to the default download folder is limited to the current image being viewed, and for a Telegram Desktop folder with a lot of files it is really inconvenient to have to look and find the ones I want right now.

@telegramdesktop telegramdesktop deleted a comment from danger89 Oct 1, 2017

@Julian1984

This comment has been minimized.

Copy link

Julian1984 commented Feb 1, 2018

Just an up to this enhancement. It's necessary to get this option to download or resend images.

@Zebradil

This comment has been minimized.

Copy link

Zebradil commented Feb 3, 2018

Quick tip. It is possible to download media with small python script.

  1. Goto https://my.telegram.org and generate api id and api hash
  2. Install Telethon library with pip3 install telethon
  3. Run following code (replace api_id, api_hash and username with your values):
from telethon import TelegramClient
api_id=123456
api_hash='secretHashYO'
client = TelegramClient('test_session', api_id, api_hash)
client.start()
for message in client.get_message_history('username', limit=25):
    client.download_media(message)

This code downloads media from the last 25 messages from the dialog with username user in current directory.

@moham96

This comment has been minimized.

Copy link

moham96 commented Feb 22, 2018

This would be extremely useful not for images only but also for files

@ganesh-deshmukh

This comment has been minimized.

Copy link

ganesh-deshmukh commented Jul 11, 2018

@Zebradil , nice trick to download, but can it download all videos of the specific group?

@Zebradil

This comment has been minimized.

Copy link

Zebradil commented Jul 11, 2018

@ganeshdeshmukh1612, At the moment I used this approach there was no way to request only media files. If Telegram API is not changed, you have to iterate over all messages in a channel and process each of them one by one.

@drakmail

This comment has been minimized.

Copy link

drakmail commented Oct 6, 2018

@ganeshdeshmukh1612 I used this script to download all media from specific group:

requirements.txt

beautifulsoup4==4.6.0
certifi==2017.11.5
chardet==3.0.4
click==6.7
Django==1.11.9
dparse==0.4.1
idna==2.6
mercurial==4.4.2
packaging==17.1
protobuf==3.5.1
pycairo==1.17.0
pygobject==3.28.2
pyparsing==2.2.0
pytz==2017.3
PyYAML==3.13
requests==2.18.4
safety==1.8.4
six==1.11.0
sshuttle==0.78.3
urllib3==1.22
virtualenv==15.1.0
pip install -r requirements.txt
from telethon import TelegramClient
import telethon.sync

import asyncio
import socks

api_id = PLACE_YOUR_APP_ID_HERE
api_hash = PLACE_YOUR_API_HASH_HERE

# to use with TOR proxy
client = TelegramClient('my_session', api_id, api_hash, proxy=(socks.SOCKS5, 'localhost', 9150))
# to use without proxy
# client = TelegramClient('my_session', api_id, api_hash)

client.start()

def load_messages():
    dialogs = client.get_dialogs()
    chat = None

    for dialog in dialogs:
        if dialog.name == YOUR_GROUP_NAME_HERE:
            chat = dialog
            break

    for message in client.iter_messages(chat):
        if message.media:
            print('Downloading...')
            client.download_media(message)

load_messages()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.