Advertisement
stuppid_bot

Сохраняем в альбом фотки из группы

Aug 16th, 2014
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #-*-coding:u8-*-
  2. from vklib import *
  3. from account import *
  4.  
  5. vk=VKClient(delay_time=.5)
  6. vk.login(username, password)
  7.  
  8. oid=-35184195
  9. my_album=200877233
  10. offset=0
  11. count=1000
  12. while 1:
  13.     r = vk.api('photos.get', rev=1, owner_id=oid, album_id='wall', offset=offset, count=count)
  14.     print '%s/%s' % (offset, r['count'])
  15.     for it in r['items']:
  16.         photo_id = vk.api('photos.copy', owner_id=oid, photo_id=it['id'])
  17.         vk.api('photos.move', target_album_id=my_album, photo_id=photo_id)
  18.     offset += count
  19.     if offset >= r['count']:
  20.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement