1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-15 02:43:02 +08:00

More generic support for Ooyala Player

This commit adds more generic support for Ooyala Player. It should remove the need for slashdot.py and vice.py (but I will leave that decision up to others), as well as add support for sites that don't follow the usual pattern by searching for "var embedCode" which as best as I can tell is a variable unique to Ooyala Player and shouldn't cause any false positives or conflicts with other extractors.
This commit is contained in:
anovicecodemonkey 2014-03-17 02:02:54 +10:30
parent b6c1ceccc2
commit c445991679

View File

@ -392,10 +392,18 @@ class GenericIE(InfoExtractor):
return self.url_result(mobj.group('url'))
# Look for Ooyala videos
# First, try and see if the full player URL is provided
mobj = re.search(r'player.ooyala.com/[^"?]+\?[^"]*?(?:embedCode|ec)=([^"&]+)', webpage)
if mobj is not None:
return OoyalaIE._build_url_result(mobj.group(1))
# If it isn't, you have to dig deeper. "OO.Player.create" can be given different values.
# Best bet is to simply look for the embed code variable inside the Javascript.
mobj = re.search(r"var embedCode = '(.*?)';", webpage)
if mobj is not None:
return OoyalaIE._build_url_result(mobj.group(1))
# Look for Aparat videos
mobj = re.search(r'<iframe src="(http://www\.aparat\.com/video/[^"]+)"', webpage)
if mobj is not None: