mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 01:31:25 +01:00
Compare commits
8 Commits
9fa2ea4fd4
...
8f61d47c2b
Author | SHA1 | Date | |
---|---|---|---|
|
8f61d47c2b | ||
|
b83ca24eb7 | ||
|
240a7d43c8 | ||
|
f13df591d4 | ||
|
ddc7e9a1bb | ||
|
a434c7b7e2 | ||
|
75ff02cf4e | ||
|
4e17e8eec2 |
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
|
@ -504,7 +504,8 @@ jobs:
|
|||
- windows32
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifact
|
||||
pattern: build-bin-*
|
||||
|
|
17
.github/workflows/release-master.yml
vendored
17
.github/workflows/release-master.yml
vendored
|
@ -28,3 +28,20 @@ jobs:
|
|||
actions: write # For cleaning up cache
|
||||
id-token: write # mandatory for trusted publishing
|
||||
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
|
||||
|
|
17
.github/workflows/release-nightly.yml
vendored
17
.github/workflows/release-nightly.yml
vendored
|
@ -41,3 +41,20 @@ jobs:
|
|||
actions: write # For cleaning up cache
|
||||
id-token: write # mandatory for trusted publishing
|
||||
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
|
||||
|
|
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
|
@ -2,10 +2,6 @@ name: Release
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
prerelease:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
source:
|
||||
required: false
|
||||
default: ''
|
||||
|
@ -18,6 +14,10 @@ on:
|
|||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
prerelease:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source:
|
||||
|
@ -278,11 +278,20 @@ jobs:
|
|||
make clean-cache
|
||||
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
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
verbose: true
|
||||
attestations: false # Currently doesn't work w/ reusable workflows (breaks nightly)
|
||||
|
||||
publish:
|
||||
needs: [prepare, build]
|
||||
|
|
|
@ -52,7 +52,7 @@ default = [
|
|||
"pycryptodomex",
|
||||
"requests>=2.32.2,<3",
|
||||
"urllib3>=1.26.17,<3",
|
||||
"websockets>=13.0",
|
||||
"websockets>=13.0,<14",
|
||||
]
|
||||
curl-cffi = [
|
||||
"curl-cffi==0.5.10; os_name=='nt' and implementation_name=='cpython'",
|
||||
|
|
|
@ -24,7 +24,7 @@ try:
|
|||
from Crypto.Cipher import AES, PKCS1_OAEP, Blowfish, PKCS1_v1_5 # noqa: F401
|
||||
from Crypto.Hash import CMAC, SHA1 # noqa: F401
|
||||
from Crypto.PublicKey import RSA # noqa: F401
|
||||
except ImportError:
|
||||
except (ImportError, OSError):
|
||||
__version__ = f'broken {__version__}'.strip()
|
||||
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ from .archiveorg import (
|
|||
from .arcpublishing import ArcPublishingIE
|
||||
from .ard import (
|
||||
ARDIE,
|
||||
ARDAudiothekIE,
|
||||
ARDBetaMediathekIE,
|
||||
ARDMediathekCollectionIE,
|
||||
)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import functools
|
||||
import json
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
@ -601,3 +602,120 @@ class ARDMediathekCollectionIE(InfoExtractor):
|
|||
return self.playlist_result(
|
||||
OnDemandPagedList(fetch_page, self._PAGE_SIZE), full_id, display_id=display_id,
|
||||
title=page_data.get('title'), description=page_data.get('synopsis'))
|
||||
|
||||
|
||||
class ARDAudiothekIE(InfoExtractor):
|
||||
IE_NAME = 'ARD:audiothek'
|
||||
_VALID_URL = r'''(?x)https://
|
||||
(?:www\.)?ardaudiothek\.de/
|
||||
(?:player|live|episode|(?P<playlist>sendung|serie|sammlung))/
|
||||
(?P<display_id>(?(playlist)[^?#]+?|[^?#]+))/
|
||||
(?P<id>[a-zA-Z0-9]+)
|
||||
(?(playlist)/(?P<season>\d+)?/?(?:[?#]|$))'''
|
||||
|
||||
_TESTS = [{
|
||||
'url': 'https://www.ardaudiothek.de/sendung/1live-caiman-club/53375276/',
|
||||
'info_dict': {
|
||||
'id': '53375276',
|
||||
'title': '1LIVE Caiman Club',
|
||||
'description': 'md5:003cff043a41b14cf045b960b89aaa86',
|
||||
},
|
||||
'playlist_mincount': 22,
|
||||
}, {
|
||||
'url': 'https://www.ardaudiothek.de/episode/1live-caiman-club/caiman-club-s04e04-cash-out/1live/13556081/',
|
||||
'info_dict': {
|
||||
'id': '13556081',
|
||||
'ext': 'mp3',
|
||||
'upload_date': '20240717',
|
||||
'duration': 3339,
|
||||
'title': 'CAIMAN CLUB (S04E04): Cash Out',
|
||||
'thumbnail': 'https://api.ardmediathek.de/image-service/images/urn:ard:image:d5014b612429c396',
|
||||
'description': 'md5:8decf7974ed1cbf5a9d2c537940e1c4b',
|
||||
'display_id': '1live-caiman-club/caiman-club-s04e04-cash-out/1live',
|
||||
'timestamp': 1721181641,
|
||||
'series': '1LIVE Caiman Club',
|
||||
|
||||
},
|
||||
}]
|
||||
|
||||
_QUERY_PLAYLIST = '''\
|
||||
show(id: "%s") {
|
||||
title
|
||||
description
|
||||
items {
|
||||
nodes {
|
||||
url
|
||||
episodeNumber
|
||||
grouping
|
||||
isPublished
|
||||
}
|
||||
}
|
||||
}'''
|
||||
|
||||
_QUERY_ITEM = '''\
|
||||
item(id: "%s") {
|
||||
audioList {
|
||||
href
|
||||
distributionType
|
||||
}
|
||||
show {
|
||||
title
|
||||
}
|
||||
image {
|
||||
url
|
||||
}
|
||||
synopsis
|
||||
title
|
||||
duration
|
||||
startDate
|
||||
}'''
|
||||
|
||||
_GRAPHQL_ENDPOINT = 'https://api.ardaudiothek.de/graphql'
|
||||
|
||||
def _graphql_query(self, display_id, query):
|
||||
return self._download_json(
|
||||
self._GRAPHQL_ENDPOINT,
|
||||
display_id,
|
||||
data=json.dumps({'query': '{' + query + '}'}).encode(),
|
||||
headers={
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
)['data']
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id, display_id, playlist_type, season_number = self._match_valid_url(url).group(
|
||||
'id', 'display_id', 'playlist', 'season')
|
||||
if re.match('^[/-]*$', display_id):
|
||||
display_id = video_id
|
||||
|
||||
if playlist_type:
|
||||
playlist_info = self.graphql_query(display_id, self._QUERY_PLAYLIST % video_id)['show']
|
||||
episodes = playlist_info['items']['nodes']
|
||||
entries = []
|
||||
for episode in episodes:
|
||||
if episode['isPublished']:
|
||||
entries.append(self.url_result(
|
||||
episode['url'],
|
||||
ie=ARDAudiothekIE.ie_key()))
|
||||
return self.playlist_result(entries, video_id, playlist_title=display_id, **traverse_obj(playlist_info, {
|
||||
'title': ('title', {str}),
|
||||
'description': ('description', {str}),
|
||||
}))
|
||||
|
||||
return {
|
||||
'display_id': display_id,
|
||||
'formats': traverse_obj(self.graphql_query(display_id, self._QUERY_ITEM % video_id), (
|
||||
'item', 'audioList', lambda _, v: url_or_none(v['href']), {
|
||||
'url': 'href',
|
||||
'format_id': ('distributionType', {str}),
|
||||
})),
|
||||
'id': video_id,
|
||||
**traverse_obj(item, {
|
||||
'description': ('synopsis', {str}),
|
||||
'duration': ('duration', {int_or_none}),
|
||||
'series': ('show', 'title'),
|
||||
'thumbnail': ('image', 'url', {url_or_none}),
|
||||
'timestamp': ('startDate', {parse_iso8601}),
|
||||
'title': ('title', {str}),
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user