-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathikiu_vc_dl.py
49 lines (40 loc) · 1.48 KB
/
ikiu_vc_dl.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
from downloader import Downloader
import time
import re
import exporter
def ikiu_download(user_name, password, pasted_urls):
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36',
}
login_data = {
'anchor': '',
'username': user_name,
'password': password,
'rememberusername': '0'
}
ikiu_downloader = Downloader('http://lms.ikiu.ac.ir/blocks/whc_backup/login.php',
'https://ac.aminidc.com',
login_data, headers, headers)
if not ikiu_downloader.login({'logintoken'}):
return
for url in pasted_urls:
if re.match(r'https://ac\.aminidc\.com/(.*)/.*', url):
filename=re.findall('recording=(\d+)&', url)[0]
print('Downloading ' + filename + '...')
if not ikiu_downloader.download_meeting(url):
print('An error occurred during download...')
time.sleep(10)
continue
exporter.export(filename)
ikiu_downloader.download_other_files()
print(filename + ' is ready!')
else:
print('Wrong URL format')
time.sleep(10)
ikiu_downloader.remove_temp_directory()
if __name__ == '__main__':
with open('info.txt', 'r') as f:
lines = f.read().splitlines()
user_name = lines[0]
password = lines[1]
ikiu_download(user_name, password, lines[2:])