[mtv] Use compat_xpath and fix FutureWarning
authorSergey M․ <dstftw@gmail.com>
Fri, 17 Jun 2016 21:46:26 +0000 (04:46 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 17 Jun 2016 21:46:26 +0000 (04:46 +0700)
youtube_dl/extractor/mtv.py

index 640ee3d9339c48e2b3fef0ade15ee8ebcae8b292..8a638a47c56c272d57cc2bed99f04fdd71b789a2 100644 (file)
@@ -6,6 +6,7 @@ from .common import InfoExtractor
 from ..compat import (
     compat_urllib_parse_urlencode,
     compat_str,
+    compat_xpath,
 )
 from ..utils import (
     ExtractorError,
@@ -139,9 +140,9 @@ class MTVServicesInfoExtractor(InfoExtractor):
                 itemdoc, './/{http://search.yahoo.com/mrss/}category',
                 'scheme', 'urn:mtvn:video_title')
         if title_el is None:
-            title_el = itemdoc.find('.//{http://search.yahoo.com/mrss/}title')
+            title_el = itemdoc.find(compat_xpath('.//{http://search.yahoo.com/mrss/}title'))
         if title_el is None:
-            title_el = itemdoc.find('.//title') or itemdoc.find('./title')
+            title_el = itemdoc.find(compat_xpath('.//title'))
             if title_el.text is None:
                 title_el = None