- view_count = self._search_regex(r'Views: (.+?)<br />',
- webpage, 'Views Count')
- description = self._search_regex(r'<meta property="og:description" content="(.+?)" />',
- webpage, 'video description')
- video_id = self._search_regex(r'<meta property="og:video" content="(.+?)" />',
- webpage, 'Video id').split('=')[1]
-
- info_url = "http://www.traileraddict.com/fvar.php?tid=%s" %(str(video_id))
+ view_count_str = self._search_regex(
+ r'<span class="views_n">([0-9,.]+)</span>',
+ webpage, 'view count', fatal=False)
+ view_count = (
+ None if view_count_str is None
+ else int(view_count_str.replace(',', '')))
+ video_id = self._search_regex(
+ r'<param\s+name="movie"\s+value="/emb/([0-9]+)"\s*/>',
+ webpage, 'video id')
+
+ # Presence of (no)watchplus function indicates HD quality is available
+ if re.search(r'function (no)?watchplus()', webpage):
+ fvar = "fvarhd"
+ else:
+ fvar = "fvar"
+
+ info_url = "http://www.traileraddict.com/%s.php?tid=%s" % (fvar, str(video_id))