[Flipagram] Add new extractor
This commit is contained in:
parent
b5abf86148
commit
b469c1305c
@ -237,6 +237,7 @@ from .fivemin import FiveMinIE
|
|||||||
from .fivetv import FiveTVIE
|
from .fivetv import FiveTVIE
|
||||||
from .fktv import FKTVIE
|
from .fktv import FKTVIE
|
||||||
from .flickr import FlickrIE
|
from .flickr import FlickrIE
|
||||||
|
from .flipagram import FlipagramIE
|
||||||
from .folketinget import FolketingetIE
|
from .folketinget import FolketingetIE
|
||||||
from .footyroom import FootyRoomIE
|
from .footyroom import FootyRoomIE
|
||||||
from .fourtube import FourTubeIE
|
from .fourtube import FourTubeIE
|
||||||
|
35
youtube_dl/extractor/flipagram.py
Normal file
35
youtube_dl/extractor/flipagram.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class FlipagramIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?:\/\/(?:www\.)?flipagram\.com\/f\/(?P<id>.+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://flipagram.com/f/myrWjW9RJw',
|
||||||
|
'md5': '541988fb6c4c7c375215ea22a4a21841',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'myrWjW9RJw',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Flipagram by crystaldolce featuring King and Lionheart by Of Monsters and Men',
|
||||||
|
'width': 720,
|
||||||
|
'height': 1280,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
title = self._html_search_regex(r'<title>(.*)</title>', webpage, 'title')
|
||||||
|
video_url = self._html_search_regex(r'"contentUrl":"(https?://[^\"]+)', webpage, 'video URL')
|
||||||
|
width = self._html_search_regex(r'embed","width":([0-9]+)', webpage, 'width', fatal=False)
|
||||||
|
height = self._html_search_regex(r'embed",.*"height":([0-9]+)', webpage, 'height', fatal=False)
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'url': video_url,
|
||||||
|
'width': int(width),
|
||||||
|
'height': int(height),
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user