Created
October 26, 2018 20:19
-
-
Save stek29/768093f8efd6c7d37726a5875aa8d4d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telethon.sync | |
from telethon.tl.types import WallPaper | |
from telethon.tl.functions.account import GetWallPapersRequest | |
# see telethon docs to get client | |
w = client(GetWallPapersRequest()) | |
for i, wp in enumerate(w): | |
if not isinstance(wp, WallPaper): | |
continue | |
for s in wp.sizes: | |
fn = '{}-{}.jpg'.format(s.type, i) | |
print(fn) | |
client.download_file(s.location, fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment