4 from .common
import InfoExtractor
7 class PhotobucketIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:[a-z0-9]+\.)?photobucket\.com/.*(([\?\&]current=)|_)(?P<id>.*)\.(?P<ext>(flv)|(mp4))'
10 'url': 'http://media.photobucket.com/user/rachaneronas/media/TiredofLinkBuildingTryBacklinkMyDomaincom_zpsc0c3b9fa.mp4.html?filters[term]=search&filters[primary]=videos&filters[secondary]=images&sort=1&o=0',
11 'md5': '7dabfb92b0a31f6c16cebc0f8e60ff99',
15 'timestamp': 1367669341,
16 'upload_date': '20130504',
17 'uploader': 'rachaneronas',
18 'title': 'Tired of Link Building? Try BacklinkMyDomain.com!',
22 def _real_extract(self
, url
):
23 mobj
= self
._match
_valid
_url
(url
)
24 video_id
= mobj
.group('id')
25 video_extension
= mobj
.group('ext')
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 # Extract URL, uploader, and title from webpage
30 self
.report_extraction(video_id
)
31 info_json
= self
._search
_regex
(r
'Pb\.Data\.Shared\.put\(Pb\.Data\.Shared\.MEDIA, (.*?)\);',
33 info
= json
.loads(info_json
)
34 url
= urllib
.parse
.unquote(self
._html
_search
_regex
(r
'file=(.+\.mp4)', info
['linkcodes']['html'], 'url'))
38 'uploader': info
['username'],
39 'timestamp': info
['creationDate'],
40 'title': info
['title'],
41 'ext': video_extension
,
42 'thumbnail': info
['thumbUrl'],