1.py 549 B

12345678910111213141516171819202122232425262728293031
  1. from telethon import sync, events
  2. import time
  3. from telethon import TelegramClient
  4. n = 0
  5. ss = 879 #количество песен в группе
  6. api_id = 14881488 #ваш api_id
  7. api_hash = "ваш api_id"
  8. session = str("anon")
  9. client = TelegramClient(session, api_id, api_hash)
  10. client.start()
  11. while(True):
  12. msgs = client.get_messages('music_black_triangle', limit=ss)
  13. for msg in msgs:
  14. if msg.media is not None:
  15. client.download_media(message=msg)
  16. time.sleep(3)
  17. n = n + 1
  18. print("Скачано ")
  19. time.sleep(2)
  20. if n == 1:
  21. break