-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathysearch.py
78 lines (67 loc) · 1.54 KB
/
ysearch.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from unicodedata import name
from youtubesearchpython import *
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate("service.json")
firebase_admin.initialize_app(cred)
db=firestore.client()
tp = [
'Html',
'Python',
'C++',
'C#',
'Java',
'C',
'Javascript',
'PHP',
'Reactjs',
'Angularjs',
'Flutter',
'Expressjs',
'Sql',
'MangoDB',
'Swift',
'Kotlin',
'Go',
'Solidity',
'Flask',
'Django',
'R',
'TypeScript',
'Vuejs',
'Nodejs',
'Shellscript',
'.Net',
'XB.Net',
'Asp.Net'
]
def salman(inh):
cs=CustomSearch(f"{inh} programming",VideoDurationFilter.long,limit=6)
for i in range(6):
_name=cs.result()['result'][i]['channel']['name']
link=cs.result()['result'][i]['link']
dur=cs.result()['result'][i]['duration']
icon=cs.result()['result'][i]['channel']['thumbnails'][0]['url']
view=cs.result()['result'][i]['viewCount']['short']
thumb=cs.result()['result'][i]['thumbnails'][0]['url']
url =icon.replace("s68", "s200" )
db.collection('all').document(inh).collection('nyt').document(_name).set({
'title':_name,
'img':url,
'dur':dur,
'views':view,
'topic':inh,
'url':link,
'thumb':thumb,
'value':i
})
print("------------------------------")
print(_name)
print(link)
print(dur)
print(view)
print(url)
for i in tp:
salman(i)
print(i)