Advertisement
Guest User

vk_music_loader_9000_HOTFIX

a guest
Oct 18th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. import vk
  2. import urllib
  3. #from   mutagen.easyid3 import EasyID3
  4. #from   mutagen.mp3     import MP3
  5. #from   mutagen.id3     import ID3, TIT2, TALB, TPE1, TPE2, COMM, USLT, TCOM, TCON, TDRC
  6.  
  7. username = 'your anus'
  8. password = 'my anus'
  9.  
  10. ownerId  = 'our anus id'
  11.  
  12.  
  13. def connect():
  14.     global username
  15.     global password
  16.  
  17.     print("[x]      Connecting")
  18.     session = vk.AuthSession(app_id='5671916', user_login=username, user_password=password, scope=2+4+8+65536+262144)
  19.     print("[x]      Connected")
  20.     return vk.API(session)
  21.  
  22. def getList(apiobj):
  23.     global ownerId
  24.     return apiobj.audio.get(owner_id=ownerId)
  25.  
  26. def startLoad(list):
  27.     global savepath
  28.     for i in range(1,len(list)-1):
  29.         try:
  30.             list[i]['artist'].replace('/','_')
  31.             list[i]['title'].replace('/','_')
  32.             dest_filename = list[i]['artist'] + ' - ' + list[i]['title'] + '.mp3'
  33.             print("[" + str(i) + "/" + str(list[0]) + "] " + "      Loading:" + dest_filename)
  34.             urllib.urlretrieve(list[i]['url'], dest_filename)
  35.             #print("Loaded. Fixing ID3-tags")
  36.             #aud = ID3()
  37.             #aud["TIT2"] = TIT2(encoding=3, text=list[i]['title'])
  38.             #aud["TPE1"] = TPE1(encoding=3, text=list[i]['artist'])
  39.             #aud.save(dest_filename)
  40.         except:
  41.             print("         Error while loading; or saving; I dont know, i'm lazy")
  42.             print("[x]      " + dest_filename)
  43.         finally:
  44.             pass
  45.  
  46. startLoad(getList(connect()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement