Compare commits

...

6 Commits

Author SHA1 Message Date
Alvear Devs
2f85c0c226
Merge e79bcc5691 into b83ca24eb7 2024-11-10 09:19:38 +05:30
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
Alvear Devs
e79bcc5691
Merge branch 'yt-dlp:master' into mercadolibre 2024-08-12 17:29:47 -03:00
ajnar
28445dbfbf [MercadoLibre] Add extractor 2024-06-10 20:59:18 -03:00
8 changed files with 166 additions and 8 deletions

View File

@ -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-*

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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'",

View File

@ -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()

View File

@ -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 (

View 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