瀏覽代碼

[MiomioTv] updated based on feedback to merge request:
1) added comment to explain extra xml link download
2) changed {} entries to {0}, {1} etc
3) removed redundant language header (the others are required)
4) checked out the old version of the supported sites md (the change was
not required)

tiktok 10 年之前
父節點
當前提交
5d1f0e607b
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 0 1
      docs/supportedsites.md
  2. 8 4
      youtube_dl/extractor/miomio_tv.py

+ 0 - 1
docs/supportedsites.md

@@ -244,7 +244,6 @@
  - **Mgoon**
  - **Mgoon**
  - **Minhateca**
  - **Minhateca**
  - **MinistryGrid**
  - **MinistryGrid**
- - **Miomio.tv**
  - **mitele.es**
  - **mitele.es**
  - **mixcloud**
  - **mixcloud**
  - **MLB**
  - **MLB**

+ 8 - 4
youtube_dl/extractor/miomio_tv.py

@@ -23,10 +23,15 @@ class MiomioTvIE(InfoExtractor):
 
 
         title = self._html_search_regex(r'<meta\s+name="description"\s+content="\s*([^"]*)\s*"', webpage, 'title')
         title = self._html_search_regex(r'<meta\s+name="description"\s+content="\s*([^"]*)\s*"', webpage, 'title')
         ref_path = self._search_regex(r'src="(/mioplayer/.*?)"', webpage, 'ref_path')
         ref_path = self._search_regex(r'src="(/mioplayer/.*?)"', webpage, 'ref_path')
-        referer = 'http://www.miomio.tv{}'.format(ref_path)
+        referer = 'http://www.miomio.tv{0}'.format(ref_path)
         xml_config = self._search_regex(r'flashvars="type=sina&amp;(.*?)&amp;cid=', webpage, 'xml config')
         xml_config = self._search_regex(r'flashvars="type=sina&amp;(.*?)&amp;cid=', webpage, 'xml config')
-        self._request_webpage("http://www.miomio.tv/mioplayer/mioplayerconfigfiles/xml.php?id={}&r=cc{}".format(id, 945), video_id)
-        xml_url = 'http://www.miomio.tv/mioplayer/mioplayerconfigfiles/sina.php?{}'.format(xml_config)
+        
+        # skipping the following page causes lags and eventually connection drop-outs
+        # id is normally a rotating three digit value but a fixed value always appears to work
+        self._request_webpage("http://www.miomio.tv/mioplayer/mioplayerconfigfiles/xml.php?id={0}&r=cc{1}".format(id, 945), video_id)
+
+        # the following xml contains the actual configuration information on the video file(s)
+        xml_url = 'http://www.miomio.tv/mioplayer/mioplayerconfigfiles/sina.php?{0}'.format(xml_config)
         vidconfig = self._download_xml(xml_url, video_id)
         vidconfig = self._download_xml(xml_url, video_id)
 
 
         file_els = vidconfig.findall('.//durl')
         file_els = vidconfig.findall('.//durl')
@@ -48,7 +53,6 @@ class MiomioTvIE(InfoExtractor):
 
 
         http_headers = {
         http_headers = {
             'Referer': referer,
             'Referer': referer,
-            'Accept-Language': 'en,en-US;q=0.7,de;q=0.3',
             'Accept-Encoding': 'gzip, deflate',
             'Accept-Encoding': 'gzip, deflate',
             'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
             'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
         }
         }