File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 18
18
for i , item in enumerate (video ):
19
19
video = result ['entries' ][i ]
20
20
# fetch the url and title of video
21
- print ('|' + result ['entries' ][i ]['title' ] + '|[Watch](' + result ['entries' ][i ]['webpage_url' ]+ ')|' + '-|' )
21
+ print ('|' + result ['entries' ][i ]['title' ] + '|[Watch Here](' + result ['entries' ][i ]['webpage_url' ]+ ')|' + '-|' )
22
+
23
+ #Alternate method
24
+ import youtube_dl
25
+ import os
26
+
27
+ start = 101 ;
28
+ end = 154 ;
29
+
30
+ # For fetching the title of the video in playlist
31
+ cmd_code1 = 'py -m youtube_dl -e --playlist-start ' + str (start )+ ' --playlist-end ' + str (end )+ ' https://www.youtube.com/playlist?list=PLj6h78yzYM2PpmMAnvpvsnR4c27wJePh3'
32
+ title = os .popen (cmd_code1 ).read ().splitlines ()
33
+ #print(title[0])
34
+
35
+ # For fetching the id of that particular video in playlist
36
+ cmd_code2 = 'py -m youtube_dl --get-id --playlist-start ' + str (start )+ ' --playlist-end ' + str (end )+ ' https://www.youtube.com/playlist?list=PLj6h78yzYM2PpmMAnvpvsnR4c27wJePh3'
37
+ video_id = os .popen (cmd_code2 ).read ().splitlines ()
38
+
39
+ print ('| Topic | Video | Presentation |' )
40
+ print ('| ------------- |:-------------:| -----:|' )
41
+
42
+ for i in range (0 , len (title )):
43
+ print ('|' + title [i ] + '|[Watch Here](https://www.youtube.com/watch?v=' + video_id [i ]+ ')|' + '-|' )
You can’t perform that action at this time.
0 commit comments