[utils] make_HTTPS_handler: Remove try/except block that would always raise an exception
[youtube-dl] / youtube_dl / extractor / youporn.py
index 97ef9c17e5b29e8aa9bd72c027acab63a74d81b3..d9c06a2ee6d934391560b6ca7db4ebecf40ff1d0 100644 (file)
@@ -45,11 +45,13 @@ class YouPornIE(InfoExtractor):
         age_limit = self._rta_search(webpage)
 
         # Get JSON parameters
-        json_params = self._search_regex(r'var currentVideo = new Video\((.*)\);', webpage, 'JSON parameters')
+        json_params = self._search_regex(
+            r'var currentVideo = new Video\((.*)\)[,;]',
+            webpage, 'JSON parameters')
         try:
             params = json.loads(json_params)
         except:
-            raise ExtractorError(u'Invalid JSON')
+            raise ExtractorError('Invalid JSON')
 
         self.report_extraction(video_id)
         try:
@@ -103,7 +105,7 @@ class YouPornIE(InfoExtractor):
         self._sort_formats(formats)
 
         if not formats:
-            raise ExtractorError(u'ERROR: no known formats available for video')
+            raise ExtractorError('ERROR: no known formats available for video')
 
         return {
             'id': video_id,