1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[cleanup] Mark some compat variables for removal (#2173)

Authored by fstirlitz, pukkandan
This commit is contained in:
pukkandan
2022-04-12 01:39:26 +05:30
parent cfb0511d82
commit f9934b9614
26 changed files with 134 additions and 199 deletions

View File

@ -4,6 +4,7 @@ from __future__ import unicode_literals
import os
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from .youtube import YoutubeIE
@ -12,7 +13,6 @@ from ..compat import (
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils import (
determine_ext,
@ -2827,7 +2827,7 @@ class GenericIE(InfoExtractor):
try:
try:
doc = compat_etree_fromstring(webpage)
except compat_xml_parse_error:
except xml.etree.ElementTree.ParseError:
doc = compat_etree_fromstring(webpage.encode('utf-8'))
if doc.tag == 'rss':
self.report_detected('RSS feed')
@ -2862,7 +2862,7 @@ class GenericIE(InfoExtractor):
self.report_detected('F4M manifest')
self._sort_formats(info_dict['formats'])
return info_dict
except compat_xml_parse_error:
except xml.etree.ElementTree.ParseError:
pass
# Is it a Camtasia project?