[animeondemand] Pass num for episode based videos
authorSergey M․ <dstftw@gmail.com>
Sat, 9 Jul 2016 00:13:32 +0000 (07:13 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 9 Jul 2016 00:13:32 +0000 (07:13 +0700)
youtube_dl/extractor/animeondemand.py

index 1f044e20bf3cd2d419f09246fdf043a64ef27a81..159c6ef5afa423458505e3a74f1ceadce5e31a07 100644 (file)
@@ -115,7 +115,7 @@ class AnimeOnDemandIE(InfoExtractor):
 
         entries = []
 
-        def extract_info(html, video_id):
+        def extract_info(html, video_id, num=None):
             title, description = [None] * 2
             formats = []
 
@@ -143,7 +143,7 @@ class AnimeOnDemandIE(InfoExtractor):
                         format_id_list.append(lang)
                     if kind:
                         format_id_list.append(kind)
-                    if not format_id_list:
+                    if not format_id_list and num is not None:
                         format_id_list.append(compat_str(num))
                     format_id = '-'.join(format_id_list)
                     format_note = ', '.join(filter(None, (kind, lang_note)))
@@ -203,8 +203,8 @@ class AnimeOnDemandIE(InfoExtractor):
                 'formats': formats,
             }
 
-        def extract_entries(html, video_id, common_info):
-            info = extract_info(html, video_id)
+        def extract_entries(html, video_id, common_info, num):
+            info = extract_info(html, video_id, num)
 
             if info['formats']:
                 self._sort_formats(info['formats'])