def get_video_id(self):
#looks like the filename is also the video id and some links have it at the "-"end od url
self.video_id=''
#https://j.gifs.com/zpOmn5.gif <-- this is handled in get_playable -> .gif replaced with .mp4
#http://gifs.com/gif/qxBQMp <-- parsed here.
#https://gifs.com/gif/yes-nooo-whaaa-5yZ8rK <-- parsed here.
match = re.compile('gifs\.com/(?:gif/)?(.+)(?:.gif|$)').findall(self.media_url)
#log(' matches' + repr(match) )
if match:
vid=match[0]
if '-' in vid:
vid= vid.split('-')[-1]
self.video_id=vid
评论列表
文章目录