mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 01:31:25 +01:00
Compare commits
6 Commits
83d25b065c
...
2f85c0c226
Author | SHA1 | Date | |
---|---|---|---|
|
2f85c0c226 | ||
|
b83ca24eb7 | ||
|
240a7d43c8 | ||
|
f13df591d4 | ||
|
e79bcc5691 | ||
|
28445dbfbf |
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()
|
||||
|
||||
|
||||
|
|
|
@ -1120,6 +1120,7 @@ from .megatvcom import (
|
|||
)
|
||||
from .meipai import MeipaiIE
|
||||
from .melonvod import MelonVODIE
|
||||
from .mercadolibre import MercadoLibreIE
|
||||
from .metacritic import MetacriticIE
|
||||
from .mgtv import MGTVIE
|
||||
from .microsoftembed import (
|
||||
|
|
113
yt_dlp/extractor/mercadolibre.py
Normal file
113
yt_dlp/extractor/mercadolibre.py
Normal file
|
@ -0,0 +1,113 @@
|
|||
from .common import InfoExtractor
|
||||
from ..utils import ExtractorError, traverse_obj
|
||||
|
||||
|
||||
class MercadoLibreIE(InfoExtractor):
|
||||
|
||||
_VALID_URL = r'https?://(?:www\.|.*\.)?mercadolibre\.com\.ar/*.*/(?P<id>MLA-?[0-9]+)'
|
||||
|
||||
_TESTS = [
|
||||
{
|
||||
'url': 'https://articulo.mercadolibre.com.ar/MLA-780443524-pool-profesional-mesa-de-ping-pong-comedor-accesorios-_JM#position=5&search_layout=stack&type=item&tracking_id=b9180504-37fc-4829-adff-4320ac49464c',
|
||||
'info_dict': {
|
||||
'id': 'MLA-780443524',
|
||||
'title': 'Pool Profesional + Mesa De Ping Pong + Comedor + Accesorios',
|
||||
'price': '651.999'
|
||||
},
|
||||
'playlist': [{
|
||||
'info_dict': {
|
||||
'id': 'iUvfyU',
|
||||
'ext': 'mp4',
|
||||
'formats': 'mincount:2',
|
||||
'duration': 49.08,
|
||||
'title': 'Pool Profesional + Mesa De Ping Pong + Comedor + Accesorios',
|
||||
'view_count': int
|
||||
}
|
||||
}
|
||||
],
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
}
|
||||
},
|
||||
{
|
||||
'url': 'https://www.mercadolibre.com.ar/motorola-moto-e22-64gb-azul-4gb-ram/p/MLA25665291?pdp_filters=seller_id%3A225480741#reco_item_pos=20&reco_backend=machinalis-seller-items-pdp&reco_backend_type=low_level&reco_client=vip-seller_items-above&reco_id=08cf53bc-f759-4c39-9253-ae21f5d75ae9',
|
||||
'info_dict': {
|
||||
'id': 'MLA25665291',
|
||||
'title': 'Motorola Moto E22 64GB Azul 4GB RAM',
|
||||
'price': '399.999',
|
||||
},
|
||||
'playlist': [{
|
||||
'info_dict': {
|
||||
'id': 'gO27T5',
|
||||
'ext': 'mp4',
|
||||
'formats': 'mincount:4',
|
||||
'duration': 56.21,
|
||||
'title': 'Motorola Moto E22 64GB Azul 4GB RAM',
|
||||
'view_count': int,
|
||||
}
|
||||
}
|
||||
],
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
}
|
||||
},
|
||||
{
|
||||
'url': 'https://www.mercadolibre.com.ar/sony-playstation-5-825gb-digital-edition-color-blanco-y-negro-2020/p/MLA16253015',
|
||||
'info_dict': {
|
||||
'id': 'MLA16253015',
|
||||
'title': 'Sony PlayStation 5 825GB Digital Edition color blanco y negro 2020',
|
||||
'price': '1.779.999',
|
||||
},
|
||||
'playlist_mincount': 2,
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
def _real_initialize(self):
|
||||
self._request_webpage('https://www.mercadolibre.com.ar/', None, 'Setting up session')
|
||||
|
||||
def _real_extract(self, url):
|
||||
|
||||
display_id = self._match_id(url)
|
||||
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
|
||||
title = self._search_regex(r'<h1 class="ui-pdp-title">(.*?)</h1>', webpage, 'title', fatal=True)
|
||||
price = self._search_regex(r'<span class="andes-money-amount__fraction" aria-hidden="true">(.*?)</span>', webpage, 'precio', fatal=True)
|
||||
|
||||
data = self._search_json(
|
||||
r'window\.__PRELOADED_STATE__\s*=', webpage, 'json data', display_id)
|
||||
|
||||
shorts = traverse_obj(data, (
|
||||
'initialState', 'components', 'gallery', 'clips', 'shorts'))
|
||||
|
||||
if len(shorts) == 0:
|
||||
raise ExtractorError('No videos found at the site')
|
||||
|
||||
entries = []
|
||||
for short in shorts:
|
||||
video_id = short['id']
|
||||
video_url = short['video_url']
|
||||
|
||||
formats = self._extract_m3u8_formats(video_url, video_id)
|
||||
|
||||
entry = {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'duration': short['video_duration'],
|
||||
'view_count': short['views'],
|
||||
'formats': formats
|
||||
}
|
||||
entries.append(entry)
|
||||
|
||||
response = {
|
||||
'_type': 'playlist',
|
||||
'id': display_id,
|
||||
'title': title,
|
||||
'price': price,
|
||||
'entries': entries,
|
||||
}
|
||||
|
||||
return response
|
Loading…
Reference in New Issue
Block a user