1 from __future__ import unicode_literals
7 from .common import InfoExtractor
10 class PhotobucketIE(InfoExtractor):
11 _VALID_URL = r'http://(?:[a-z0-9]+\.)?photobucket\.com/.*(([\?\&]current=)|_)(?P<id>.*)\.(?P<ext>(flv)|(mp4))'
13 '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',
14 'file': 'zpsc0c3b9fa.mp4',
15 'md5': '7dabfb92b0a31f6c16cebc0f8e60ff99',
17 'upload_date': '20130504',
18 'uploader': 'rachaneronas',
19 'title': 'Tired of Link Building? Try BacklinkMyDomain.com!',
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group('id')
26 video_extension = mobj.group('ext')
28 webpage = self._download_webpage(url, video_id)
30 # Extract URL, uploader, and title from webpage
31 self.report_extraction(video_id)
32 info_json = self._search_regex(r'Pb\.Data\.Shared\.put\(Pb\.Data\.Shared\.MEDIA, (.*?)\);',
34 info = json.loads(info_json)
37 'url': info['downloadUrl'],
38 'uploader': info['username'],
39 'upload_date': datetime.date.fromtimestamp(info['creationDate']).strftime('%Y%m%d'),
40 'title': info['title'],
41 'ext': video_extension,
42 'thumbnail': info['thumbUrl'],