Compare commits

...

8 Commits

Author SHA1 Message Date
Simon Sawicki
ea40489ae6
Add override for generic vulnerability
Authored by: Grub4K
2023-11-14 22:24:19 +01:00
bashonly
3f3bcf3505
Merge branch 'yt-dlp:master' into cleanup/2023-11 2023-11-14 14:28:57 -06:00
bashonly
d4f14a72dc
[ie] Do not test truth value of xml.etree.ElementTree.Element (#8582)
Testing the truthiness of an `xml.etree.ElementTree.Element` instance is deprecated in py3.12

Authored by: bashonly
2023-11-14 20:28:18 +00:00
bashonly
64133dda86
[ie] Testing truthiness of XML etree Element is deprecated in py3.12
Authored by: bashonly
2023-11-14 12:37:52 -06:00
bashonly
c5eb14eadb
[ie/slideslive] Cleaning up the xml cleanup 2023-11-14 11:30:43 -06:00
bashonly
9c47ef92ea
[ie/NBCStations] Cleaning up the xml cleanup 2023-11-14 11:14:41 -06:00
bashonly
c80ba70e7e
[ie/cbc] Cleaning up the xml cleanup 2023-11-14 11:03:03 -06:00
bashonly
8dc3310845
[ie/mtv] Cleaning up the xml cleanup 2023-11-14 11:02:49 -06:00
6 changed files with 24 additions and 10 deletions

View File

@ -109,5 +109,10 @@
"action": "add",
"when": "1d03633c5a1621b9f3a756f0a4f9dc61fab3aeaa",
"short": "[priority] **The release channels have been adjusted!**\n\t* [`master`](https://github.com/yt-dlp/yt-dlp-master-builds) builds are made after each push, containing the latest fixes (but also possibly bugs). This was previously the `nightly` channel.\n\t* [`nightly`](https://github.com/yt-dlp/yt-dlp-nightly-builds) builds are now made once a day, if there were any changes."
},
{
"action": "add",
"when": "f04b5bedad7b281bee9814686bba1762bae092eb",
"short": "[priority] Security: [[CVE-2023-46121](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46121)] Patch [Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-3ch3-jhc6-5r8x)\n\t- Disallow smuggling of arbitary `http_headers`; extractors now only use specific headers"
}
]

View File

@ -1,8 +1,9 @@
import re
import json
import base64
import json
import re
import time
import urllib.parse
import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import (
@ -387,7 +388,7 @@ class CBCGemIE(InfoExtractor):
url = re.sub(r'(Manifest\(.*?),format=[\w-]+(.*?\))', r'\1\2', base_url)
secret_xml = self._download_xml(url, video_id, note='Downloading secret XML', fatal=False)
if secret_xml is None:
if not isinstance(secret_xml, xml.etree.ElementTree.Element):
return
for child in secret_xml:

View File

@ -2225,7 +2225,9 @@ class InfoExtractor:
mpd_url, video_id,
note='Downloading MPD VOD manifest' if note is None else note,
errnote='Failed to download VOD manifest' if errnote is None else errnote,
fatal=False, data=data, headers=headers, query=query) or {}
fatal=False, data=data, headers=headers, query=query)
if not isinstance(mpd_doc, xml.etree.ElementTree.Element):
return None
return int_or_none(parse_duration(mpd_doc.get('mediaPresentationDuration')))
@staticmethod

View File

@ -1,4 +1,5 @@
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from ..compat import compat_str
@ -137,7 +138,7 @@ class MTVServicesInfoExtractor(InfoExtractor):
mediagen_doc = self._download_xml(
mediagen_url, video_id, 'Downloading video urls', fatal=False)
if mediagen_doc is None:
if not isinstance(mediagen_doc, xml.etree.ElementTree.Element):
return None
item = mediagen_doc.find('./video/item')

View File

@ -1,6 +1,7 @@
import base64
import json
import re
import xml.etree.ElementTree
from .common import InfoExtractor
from .theplatform import ThePlatformIE, default_ns
@ -803,6 +804,8 @@ class NBCStationsIE(InfoExtractor):
smil = self._download_xml(
f'https://link.theplatform.com/s/{pdk_acct}/{player_id}', video_id,
note='Downloading SMIL data', query=query, fatal=is_live)
if not isinstance(smil, xml.etree.ElementTree.Element):
smil = None
subtitles = self._parse_smil_subtitles(smil, default_ns) if smil is not None else {}
for video in smil.findall(self._xpath_ns('.//video', default_ns)) if smil is not None else []:
info['duration'] = float_or_none(remove_end(video.get('dur'), 'ms'), 1000)

View File

@ -1,5 +1,6 @@
import re
import urllib.parse
import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
@ -469,11 +470,12 @@ class SlidesLiveIE(InfoExtractor):
slides = self._download_xml(
player_info['slides_xml_url'], video_id, fatal=False,
note='Downloading slides XML', errnote='Failed to download slides info')
slide_url_template = 'https://cdn.slideslive.com/data/presentations/%s/slides/big/%s%s'
for slide_id, slide in enumerate(slides.findall('./slide') if slides is not None else [], 1):
slides_info.append((
slide_id, xpath_text(slide, './slideName', 'name'), '.jpg',
int_or_none(xpath_text(slide, './timeSec', 'time'))))
if isinstance(slides, xml.etree.ElementTree.Element):
slide_url_template = 'https://cdn.slideslive.com/data/presentations/%s/slides/big/%s%s'
for slide_id, slide in enumerate(slides.findall('./slide')):
slides_info.append((
slide_id, xpath_text(slide, './slideName', 'name'), '.jpg',
int_or_none(xpath_text(slide, './timeSec', 'time'))))
chapters, thumbnails = [], []
if url_or_none(player_info.get('thumbnail')):