mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-26 17:21:23 +01:00
Compare commits
8 Commits
5d0690c3ba
...
aa42763b6c
Author | SHA1 | Date | |
---|---|---|---|
|
aa42763b6c | ||
|
b83ca24eb7 | ||
|
240a7d43c8 | ||
|
f13df591d4 | ||
|
7297a8938e | ||
|
26d876f972 | ||
|
1c5d9b91f5 | ||
|
15d91f99ca |
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()
|
||||
|
||||
|
||||
|
|
|
@ -1529,6 +1529,11 @@ from .pinterest import (
|
|||
PinterestCollectionIE,
|
||||
PinterestIE,
|
||||
)
|
||||
from .piramidetv import (
|
||||
PiramideTVChannelIE,
|
||||
PiramideTVChannelURLIE,
|
||||
PiramideTVIE,
|
||||
)
|
||||
from .pixivsketch import (
|
||||
PixivSketchIE,
|
||||
PixivSketchUserIE,
|
||||
|
|
113
yt_dlp/extractor/piramidetv.py
Normal file
113
yt_dlp/extractor/piramidetv.py
Normal file
|
@ -0,0 +1,113 @@
|
|||
from .common import InfoExtractor, SearchInfoExtractor
|
||||
from ..utils import (
|
||||
traverse_obj,
|
||||
unified_timestamp,
|
||||
url_or_none,
|
||||
)
|
||||
|
||||
|
||||
class PiramideTVIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://piramide\.tv/video/(?P<id>[\w-]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://piramide.tv/video/wWtBAORdJUTh',
|
||||
'info_dict': {
|
||||
'id': 'wWtBAORdJUTh',
|
||||
'ext': 'mp4',
|
||||
'title': 'md5:79f9c8183ea6a35c836923142cf0abcc',
|
||||
'description': '',
|
||||
'thumbnail': 'https://cdn.jwplayer.com/v2/media/W86PgQDn/thumbnails/B9gpIxkH.jpg',
|
||||
'channel': 'León Picarón',
|
||||
'channel_id': 'leonpicaron',
|
||||
'timestamp': 1696460362,
|
||||
'upload_date': '20231004',
|
||||
},
|
||||
}, {
|
||||
'url': 'https://piramide.tv/video/wcYn6li79NgN',
|
||||
'info_dict': {
|
||||
'id': 'wcYn6li79NgN',
|
||||
'title': 'ACEPTO TENER UN BEBE CON MI NOVIA\u2026? | Parte 1',
|
||||
'description': '',
|
||||
'channel': 'ARTA GAME',
|
||||
'channel_id': 'arta_game',
|
||||
},
|
||||
'playlist_count': 4,
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
def extract_video(video_id, fatal=False):
|
||||
video_data = self._download_json(f'https://hermes.piramide.tv/video/data/{video_id}',
|
||||
video_id, fatal=fatal)
|
||||
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||
f'https://cdn.piramide.tv/video/{video_id}/manifest.m3u8', video_id, fatal=fatal)
|
||||
video_info = {**traverse_obj(video_data, {
|
||||
'id': ('video', 'id', {str}),
|
||||
'title': ('video', 'title', {str}),
|
||||
'description': ('video', 'description', {str}),
|
||||
'thumbnail': ('video', 'media', 'thumbnail', {url_or_none}),
|
||||
'channel': ('video', 'channel', 'name', {str}),
|
||||
'channel_id': ('video', 'channel', 'id', {str}),
|
||||
'timestamp': ('video', 'date', {unified_timestamp}),
|
||||
}),
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
'webpage_url': f'https://piramide.tv/video/{video_id}',
|
||||
'webpage_url_basename': video_id,
|
||||
}
|
||||
next_video_id = traverse_obj(video_data, ('video', 'next_video', 'id', {str}))
|
||||
return video_info, next_video_id
|
||||
|
||||
video_id = self._match_id(url)
|
||||
entries = []
|
||||
while video_id is not None:
|
||||
video, next_video = extract_video(video_id, (not entries))
|
||||
if video.get('formats'):
|
||||
entries.append(video)
|
||||
video_id = next_video if next_video != video_id else None
|
||||
|
||||
if len(entries) == 1:
|
||||
return entries[0]
|
||||
elif len(entries) > 1:
|
||||
return self.playlist_result(entries, **traverse_obj(entries[0], {
|
||||
'id': ('id'),
|
||||
'title': ('title'),
|
||||
'description': ('description'),
|
||||
'channel': ('channel'),
|
||||
'channel_id': ('channel_id'),
|
||||
}))
|
||||
else:
|
||||
return {'id': video_id}
|
||||
|
||||
|
||||
class PiramideTVChannelURLIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://piramide\.tv/channel/(?P<id>[\w-]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://piramide.tv/channel/thekalo',
|
||||
'playlist_count': 10,
|
||||
'info_dict': {
|
||||
'id': 'thekalo',
|
||||
'title': 'thekalo',
|
||||
},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
if query := self._match_id(url):
|
||||
return self.url_result(url=f'piramidetvall:{query}', url_transparent=True)
|
||||
|
||||
|
||||
class PiramideTVChannelIE(SearchInfoExtractor):
|
||||
IE_NAME = 'PiramideTV:channel'
|
||||
_SEARCH_KEY = 'piramidetv'
|
||||
_TESTS = [{
|
||||
'url': 'piramidetv5:bobicraft',
|
||||
'playlist_count': 5,
|
||||
'info_dict': {
|
||||
'id': 'bobicraft',
|
||||
'title': 'bobicraft',
|
||||
},
|
||||
}]
|
||||
|
||||
def _search_results(self, query):
|
||||
videos = self._download_json(f'https://hermes.piramide.tv/channel/list/{query}/date/100000', query)
|
||||
for video in videos.get('videos'):
|
||||
if video_id := video.get('id'):
|
||||
yield self.url_result(f'https://piramide.tv/video/{video_id}')
|
Loading…
Reference in New Issue
Block a user