-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch.py
More file actions
31 lines (21 loc) · 642 Bytes
/
fetch.py
File metadata and controls
31 lines (21 loc) · 642 Bytes
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
import os, requests, json, time
os.system("clear")
url = "https://www.dailymotion.com/video/x7w349h"
def download_data(url):
p1 = "https://api.w03.savethevideo.com/tasks"
obj = {"type":"info","url": url }
r = requests.post(p1, json = obj)
h = json.loads(r.text)['href']
print(h)
g1 = "https://api.w03.savethevideo.com//" + h
time.sleep(3)
r2 = requests.get(g1)
jr2 = json.loads(r2.text)
#print(jr2)
print(jr2['result']['title'])
print(jr2['result']['url'])
return_data = {
"title" : jr2['result']['title'],
"url" : jr2['result']['url']
}
download_data(url)