Compare commits

...

9 Commits

Author SHA1 Message Date
Damiano Amatruda
a9568c2668
Merge a111b3ab58 into b83ca24eb7 2024-11-10 00:59:58 +01:00
sepro
b83ca24eb7
[core] Catch broken Cryptodome installations (#11486)
Authored by: seproDev
2024-11-10 00:53:49 +01:00
bashonly
240a7d43c8
[build] Pin websockets version to >=13.0,<14 (#11488)
websockets 14.0 causes CI test failures (a lot more of them)

Authored by: bashonly
2024-11-09 23:46:47 +00:00
bashonly
f13df591d4
[build] Enable attestations for trusted publishing (#11420)
Reverts 428ffb75aa

Authored by: bashonly
2024-11-09 23:26:02 +00:00
Damiano Amatruda
a111b3ab58
Merge branch 'yt-dlp:master' into generic 2023-02-07 14:38:43 +01:00
Damiano Amatruda
91d6f0cfb6
[extractor/generic] Test field 'uploader' in RSS 2022-11-20 14:12:30 +01:00
Damiano Amatruda
b52c912a45
[extractor/generic] Support Dublin Core in RSS 2022-11-20 14:09:37 +01:00
Damiano Amatruda
7748ed1eef
[extractor/generic] Keep RSS webpage URL unsmuggled 2022-11-20 01:26:01 +01:00
Damiano Amatruda
2a81c0d577
[extractor/generic] Support RSS uploader 2022-11-20 01:23:28 +01:00
7 changed files with 86 additions and 14 deletions

View File

@ -504,7 +504,8 @@ jobs:
- windows32 - windows32
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/download-artifact@v4 - name: Download artifacts
uses: actions/download-artifact@v4
with: with:
path: artifact path: artifact
pattern: build-bin-* pattern: build-bin-*

View File

@ -28,3 +28,20 @@ jobs:
actions: write # For cleaning up cache actions: write # For cleaning up cache
id-token: write # mandatory for trusted publishing id-token: write # mandatory for trusted publishing
secrets: inherit secrets: inherit
publish_pypi:
needs: [release]
if: vars.MASTER_PYPI_PROJECT != ''
runs-on: ubuntu-latest
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
name: build-pypi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true

View File

@ -41,3 +41,20 @@ jobs:
actions: write # For cleaning up cache actions: write # For cleaning up cache
id-token: write # mandatory for trusted publishing id-token: write # mandatory for trusted publishing
secrets: inherit secrets: inherit
publish_pypi:
needs: [release]
if: vars.NIGHTLY_PYPI_PROJECT != ''
runs-on: ubuntu-latest
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
name: build-pypi
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true

View File

@ -2,10 +2,6 @@ name: Release
on: on:
workflow_call: workflow_call:
inputs: inputs:
prerelease:
required: false
default: true
type: boolean
source: source:
required: false required: false
default: '' default: ''
@ -18,6 +14,10 @@ on:
required: false required: false
default: '' default: ''
type: string type: string
prerelease:
required: false
default: true
type: boolean
workflow_dispatch: workflow_dispatch:
inputs: inputs:
source: source:
@ -278,11 +278,20 @@ jobs:
make clean-cache make clean-cache
python -m build --no-isolation . python -m build --no-isolation .
- name: Upload artifacts
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: build-pypi
path: |
dist/*
compression-level: 0
- name: Publish to PyPI - name: Publish to PyPI
if: github.event_name == 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1
with: with:
verbose: true verbose: true
attestations: false # Currently doesn't work w/ reusable workflows (breaks nightly)
publish: publish:
needs: [prepare, build] needs: [prepare, build]

View File

@ -52,7 +52,7 @@ default = [
"pycryptodomex", "pycryptodomex",
"requests>=2.32.2,<3", "requests>=2.32.2,<3",
"urllib3>=1.26.17,<3", "urllib3>=1.26.17,<3",
"websockets>=13.0", "websockets>=13.0,<14",
] ]
curl-cffi = [ curl-cffi = [
"curl-cffi==0.5.10; os_name=='nt' and implementation_name=='cpython'", "curl-cffi==0.5.10; os_name=='nt' and implementation_name=='cpython'",

View File

@ -24,7 +24,7 @@ try:
from Crypto.Cipher import AES, PKCS1_OAEP, Blowfish, PKCS1_v1_5 # noqa: F401 from Crypto.Cipher import AES, PKCS1_OAEP, Blowfish, PKCS1_v1_5 # noqa: F401
from Crypto.Hash import CMAC, SHA1 # noqa: F401 from Crypto.Hash import CMAC, SHA1 # noqa: F401
from Crypto.PublicKey import RSA # noqa: F401 from Crypto.PublicKey import RSA # noqa: F401
except ImportError: except (ImportError, OSError):
__version__ = f'broken {__version__}'.strip() __version__ = f'broken {__version__}'.strip()

View File

@ -137,10 +137,13 @@ class GenericIE(InfoExtractor):
'playlist': [{ 'playlist': [{
'info_dict': { 'info_dict': {
'ext': 'mov', 'ext': 'mov',
'id': 'pdv_maddow_netcast_mov-12-03-2020-223726', 'id': 'https://nbcnewsencoding.akamaized.net/nbcnews/video/podcast/pdv_maddow_netcast_mov-11-18-2022-224832.mov',
'title': 'MSNBC Rachel Maddow (video) - 12-03-2020-223726', 'title': 'MSNBC Rachel Maddow (video) - 11-18-2022-224832',
'description': 're:.*her unique approach to storytelling.*', 'description': 're:.*her unique approach to storytelling.*',
'upload_date': '20201204', 'upload_date': '20221119',
'direct': True,
'duration': 1152.0,
'timestamp': 1668826112.0,
}, },
}], }],
'skip': 'Dead link', 'skip': 'Dead link',
@ -183,7 +186,27 @@ class GenericIE(InfoExtractor):
'description': 'CGP Grey and Brady Haran talk about YouTube, life, work, whatever.', 'description': 'CGP Grey and Brady Haran talk about YouTube, life, work, whatever.',
'title': 'Hello Internet', 'title': 'Hello Internet',
}, },
'playlist': [{
'info_dict': {
'ext': 'mp3',
'id': '52d66949e4b0a8cec3bcdd46:52d67282e4b0cca8969714fa:5e58de8a37459e0d069efda0',
'title': 'H.I. #136: Dog Bingo',
'description': 'md5:8e5d0bc18204a1451d5e32937ecf7d6d',
'thumbnail': 'https://images.squarespace-cdn.com/content/v1/52d66949e4b0a8cec3bcdd46/1582882549057-1XW68A67UR858INW8IW5/HI+slides.002.png?format=1500w',
'timestamp': 1582884807.0,
'episode': 'H.I. #136: Dog Bingo',
'episode_number': 136,
'age_limit': 0,
'duration': 4914.0,
'upload_date': '20200228',
'direct': True,
'uploader': 'Hello Internet',
},
}],
'playlist_mincount': 100, 'playlist_mincount': 100,
'params': {
'skip_download': True,
},
}, },
# RSS feed with guid # RSS feed with guid
{ {
@ -2211,6 +2234,7 @@ class GenericIE(InfoExtractor):
def _extract_rss(self, url, video_id, doc): def _extract_rss(self, url, video_id, doc):
NS_MAP = { NS_MAP = {
'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd', 'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd',
'dc': 'http://dublincore.org/specifications/dublin-core/dcmes-xml/2001-04-11/dcmes-xml-dtd.dtd',
} }
entries = [] entries = []
@ -2222,17 +2246,20 @@ class GenericIE(InfoExtractor):
continue continue
guid = try_call(lambda: it.find('guid').text) guid = try_call(lambda: it.find('guid').text)
if guid: next_url_new = smuggle_url(next_url, {'force_videoid': guid}) if guid else next_url
next_url = smuggle_url(next_url, {'force_videoid': guid})
def itunes(key): def itunes(key):
return xpath_text(it, xpath_with_ns(f'./itunes:{key}', NS_MAP), default=None) return xpath_text(it, xpath_with_ns(f'./itunes:{key}', NS_MAP), default=None)
def dc(key):
return xpath_text(it, xpath_with_ns(f'./dc:{key}', NS_MAP), default=None)
entries.append({ entries.append({
'_type': 'url_transparent', '_type': 'url_transparent',
'url': next_url, 'url': next_url_new,
'title': try_call(lambda: it.find('title').text), 'title': try_call(lambda: it.find('title').text),
'description': xpath_text(it, 'description', default=None), 'description': xpath_text(it, 'description', default=None),
'uploader': xpath_text(it, 'author', default=None) or itunes('author') or dc('creator'),
'timestamp': unified_timestamp(xpath_text(it, 'pubDate', default=None)), 'timestamp': unified_timestamp(xpath_text(it, 'pubDate', default=None)),
'duration': parse_duration(itunes('duration')), 'duration': parse_duration(itunes('duration')),
'thumbnail': url_or_none(xpath_attr(it, xpath_with_ns('./itunes:image', NS_MAP), 'href')), 'thumbnail': url_or_none(xpath_attr(it, xpath_with_ns('./itunes:image', NS_MAP), 'href')),
@ -2240,6 +2267,7 @@ class GenericIE(InfoExtractor):
'episode_number': int_or_none(itunes('episode')), 'episode_number': int_or_none(itunes('episode')),
'season_number': int_or_none(itunes('season')), 'season_number': int_or_none(itunes('season')),
'age_limit': {'true': 18, 'yes': 18, 'false': 0, 'no': 0}.get((itunes('explicit') or '').lower()), 'age_limit': {'true': 18, 'yes': 18, 'false': 0, 'no': 0}.get((itunes('explicit') or '').lower()),
'webpage_url': next_url,
}) })
return { return {