浏览代码

[youtube] Support expanding alternative format of links in description (Closes #8164)

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

+ 3 - 3
youtube_dl/extractor/youtube.py

@@ -1235,10 +1235,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             video_description = re.sub(r'''(?x)
                 <a\s+
                     (?:[a-zA-Z-]+="[^"]+"\s+)*?
-                    title="([^"]+)"\s+
+                    (?:title|href)="([^"]+)"\s+
                     (?:[a-zA-Z-]+="[^"]+"\s+)*?
-                    class="yt-uix-redirect-link"\s*>
-                [^<]+
+                    class="(?:yt-uix-redirect-link|yt-uix-sessionlink[^"]*)".*?>
+                [^<]+\.{3}\s*
                 </a>
             ''', r'\1', video_description)
             video_description = clean_html(video_description)