-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
57 lines (45 loc) · 1.29 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import logging
import multiprocessing as mp
from app import Retrieve
from app import Search
from app import Extract
logging.basicConfig(level=logging.INFO)
sr = Search()
retr = Retrieve(useproxy=True, awsprofile='default')
ex = Extract(awsprofile='default')
# list = sr.incomplete(category='user', step='all', getitems=100000)
#
# def mp_retrieve(user):
# retr.retrieve_user(user)
#
# pool = mp.Pool(processes=10)
#
# pool.map(mp_retrieve, list)
# list = sr.incomplete(category='picture')
#
# logging.info(list)
# logging.info(len(list))
#
# for post in list:
# # for post in list[0:1]:
# try:
# retr.retrieve_picture(post)
# ex.picture_details(post)
# logging.info('%s completed', post)
# except FileNotFoundError:
# logging.info('%s file not found', post)
#pictures = sr.incomplete('picture', 'retrieved')
#print(pictures)
#retr.retrieve_picture('BNKBq6LAzjq')
retr.retrieve_location(7)
# retr.retrieve_user('_mo.duinne_')
# ex.user_details('_mo.duinne_')
# for location in ['1664544623601787']:
# retr.retrieve_location(location)
# ex.location_details(location)
# for post in ['BNKBq6LAzjq']:
# retr.retrieve_picture(post)
# ex.picture_details(post)
# for user in ['world_besttravel']:
# retr.retrieve_user(user)
# ex.user_details(user)