Skip to content

Instantly share code, notes, and snippets.

@stek29
Created October 26, 2018 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stek29/768093f8efd6c7d37726a5875aa8d4d2 to your computer and use it in GitHub Desktop.
Save stek29/768093f8efd6c7d37726a5875aa8d4d2 to your computer and use it in GitHub Desktop.
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