-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (23 loc) · 777 Bytes
/
main.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
import sys
from crawler.instagram.sai_lingo_voc import SaiLingoVoc
from crawler.instagram.dl import SaiLingoVocDownloader
from publisher.xhs.publisher import Publisher
from dotenv import load_dotenv
def main():
parameters = sys.argv[1:]
# search the posts and it's link on instagram
if parameters is None or len(parameters) == 0 or parameters[0] == "1":
insta_vocabulary = SaiLingoVoc()
insta_vocabulary.run()
return
# download each post's resources, videos or pictures
if parameters[0] == "2":
dl = SaiLingoVocDownloader()
dl.run()
# publish the downloaded contents.
if parameters[0] == "3":
xhs = Publisher()
xhs.run()
if __name__ == '__main__':
load_dotenv('.env')
main()