浏览代码

[lifenews] Modernize

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

+ 4 - 4
youtube_dl/extractor/lifenews.py

@@ -8,6 +8,7 @@ from ..compat import compat_urlparse
 from ..utils import (
 from ..utils import (
     determine_ext,
     determine_ext,
     int_or_none,
     int_or_none,
+    remove_end,
     unified_strdate,
     unified_strdate,
     ExtractorError,
     ExtractorError,
 )
 )
@@ -72,10 +73,9 @@ class LifeNewsIE(InfoExtractor):
         if not videos and not iframe_link:
         if not videos and not iframe_link:
             raise ExtractorError('No media links available for %s' % video_id)
             raise ExtractorError('No media links available for %s' % video_id)
 
 
-        title = self._og_search_title(webpage)
-        TITLE_SUFFIX = ' - Первый по срочным новостям — LIFE | NEWS'
-        if title.endswith(TITLE_SUFFIX):
-            title = title[:-len(TITLE_SUFFIX)]
+        title = remove_end(
+            self._og_search_title(webpage),
+            ' - Первый по срочным новостям — LIFE | NEWS')
 
 
         description = self._og_search_description(webpage)
         description = self._og_search_description(webpage)