浏览代码

[nrk] Inline _extract_from_playback

Sergey M․ 4 年之前
父节点
当前提交
cabfd4b1f0
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      youtube_dl/extractor/nrk.py

+ 3 - 5
youtube_dl/extractor/nrk.py

@@ -143,7 +143,9 @@ class NRKIE(NRKBaseIE):
         'only_matching': True,
         'only_matching': True,
     }]
     }]
 
 
-    def _extract_from_playback(self, video_id):
+    def _real_extract(self, url):
+        video_id = self._match_id(url).split('/')[-1]
+
         path_templ = 'playback/%s/' + video_id
         path_templ = 'playback/%s/' + video_id
 
 
         def call_playback_api(item, query=None):
         def call_playback_api(item, query=None):
@@ -212,10 +214,6 @@ class NRKIE(NRKBaseIE):
             'formats': formats,
             'formats': formats,
         }
         }
 
 
-    def _real_extract(self, url):
-        video_id = self._match_id(url).split('/')[-1]
-        return self._extract_from_playback(video_id)
-
 
 
 class NRKTVIE(InfoExtractor):
 class NRKTVIE(InfoExtractor):
     IE_DESC = 'NRK TV and NRK Radio'
     IE_DESC = 'NRK TV and NRK Radio'