Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
👌 v1.2.7 Fixed empty response from SearchVideos (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmercerind committed Jul 29, 2020
1 parent e3df8ba commit cdfd4ff
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions youtubesearchpython/videos__scripthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@ def scriptResponseHandler(self):

#########Setting Video Links, IDs And Thumbnails.#########

if self.pageSource[index][-98:] == '"commandMetadata":{"webCommandMetadata":{}},"addToPlaylistCommand":{"openMiniplayer":true,"videoId':
temp+=1
if temp % 2 == 0:
id = self.pageSource[index+1][0:11]
thumbnailbuffer = []
modes = ["default", "hqdefault", "mqdefault", "sddefault", "maxresdefault"]
self.ids+=[id]
self.links+=['https://www.youtube.com/watch?v='+ id]
for mode in modes:
thumbnailbuffer+=["https://img.youtube.com/vi/" + id + "/" + mode + ".jpg"]
self.thumbnails+=[thumbnailbuffer]
if self.pageSource[index][0:9] == '/watch?v=':
id = self.pageSource[index][9:20]
modes = ["default", "hqdefault", "mqdefault", "sddefault", "maxresdefault"]
self.ids+=[id]
self.links+=['https://www.youtube.com/watch?v='+ id]
thumbnailbuffer = []
for mode in modes:
thumbnailbuffer+=["https://img.youtube.com/vi/" + id + "/" + mode + ".jpg"]
self.thumbnails+=[thumbnailbuffer]

#########Setting Video Titles.#########

Expand Down

0 comments on commit cdfd4ff

Please sign in to comment.