Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading video from la7.it #31290

Open
giusmos opened this issue Oct 15, 2022 · 12 comments
Open

Error downloading video from la7.it #31290

giusmos opened this issue Oct 15, 2022 · 12 comments
Labels
broken-IE problem with existing site extraction patch-available

Comments

@giusmos
Copy link

giusmos commented Oct 15, 2022

Hi, I get the following error when I try to download a video from www.la7.it:

sudo youtube-dl --verbose --no-playlist https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--no-playlist', 'https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.10.6 (CPython) - Linux-5.19.0-76051900-generic-x86_64-with-glibc2.35
[debug] exe versions: none
[debug] Proxy map: {}
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading webpage
ERROR: piazzapulita-puntata-del-13102022-14-10-2022-455682: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 4 column 8 (char 422)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 906, in _parse_json
    return json.loads(json_string)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 4 column 8 (char 422)
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 906, in _parse_json
    return json.loads(json_string)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 4 column 8 (char 422)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/la7.py", line 51, in _real_extract
    player_data = self._parse_json(
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 910, in _parse_json
    raise ExtractorError(errmsg, cause=ve)
youtube_dl.utils.ExtractorError: piazzapulita-puntata-del-13102022-14-10-2022-455682: Failed to parse JSON  (caused by JSONDecodeError('Expecting value: line 4 column 8 (char 422)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
@dirkf
Copy link
Contributor

dirkf commented Oct 15, 2022

I can reproduce this. The URL works with yt-dlp: we need to back-port the extractor, like this:

$ python -m youtube_dl -v -F 'https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682'
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 6ec4a2497
[debug] Python version 2.7.17 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading webpage
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading MPD manifest
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading m3u8 information
[la7.it] /content/entry/data/0/530/0_33adfnkc_0_ddfjg19j_1: Check filesize
[la7.it] /content/entry/data/0/530/0_33adfnkc_0_vtffps07_1: Check filesize
[info] Available formats for piazzapulita-puntata-del-13102022-14-10-2022-455682:
format code    extension  resolution note
dash-f1-a1-x3  m4a        audio only DASH audio   63k , m4a_dash container, mp4a.40.2 (44100Hz)
dash-f2-a1-x3  m4a        audio only DASH audio  128k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-f1-v1-x3  mp4        640x360    DASH video  599k , mp4_dash container, avc1.42c01e, 25fps, video only
dash-f2-v1-x3  mp4        1280x720   DASH video 1203k , mp4_dash container, avc1.64001f, 25fps, video only
hls-663        mp4        640x360     663k , avc1.42c01e, 25.0fps, mp4a.40.2
https-663      mp4        640x360     663k , avc1.42c01e, 25.0fps, mp4a.40.2, ~882.61MiB
hls-1331       mp4        1280x720   1331k , avc1.64001f, 25.0fps, mp4a.40.2
https-1331     mp4        1280x720   1331k , avc1.64001f, 25.0fps, mp4a.40.2, ~1.72GiB (best)
$

In your configuration you could test the la7.py in the attached zip archive. Remove the existing files la7.py* in /usr/local/bin/youtube-dl/youtube_dl/extractor, replace with the new file. You'll probably need to become admin; run youtube-dl --version at the same time.

la7.py.zip

@dirkf dirkf added broken-IE problem with existing site extraction patch-available labels Oct 15, 2022
@giusmos
Copy link
Author

giusmos commented Oct 16, 2022

Thanks for your quick response. When I access the folder "/usr/local/bin" and run "ls -la" command I get a youtube-dl file but no youtube-dl folder (see below). I have used the find command to scan the whole system but haven't found any folder called youtube-dl or youtube_dl. I am not sure then how to replace the files.

user@user:/usr/local/bin$ ls -la
total 1804
drwxr-xr-x 2 root root 4096 Oct 16 11:01 .
drwxr-xr-x 10 root root 4096 Feb 19 2022 ..
lrwxrwxrwx 1 root root 16 Oct 14 20:31 python -> /usr/bin/python3
-rwxr-xr-x 1 root root 1837828 Dec 16 2021 youtube-dl

@dirkf
Copy link
Contributor

dirkf commented Oct 16, 2022

Ah. Maybe the single executable file installation (is that what you used?) appears to have installed itself in /usr/local/bin while it's running.

When a PR appears to fix this I'll suggest how to install it for testing.

@giusmos
Copy link
Author

giusmos commented Oct 16, 2022

Yes, I have installed it using the following commands as in the instructions:

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

@dirkf
Copy link
Contributor

dirkf commented Oct 26, 2022

See yt-dlp/yt-dlp#5360 (comment) for another necessary change to be rolled in.

@giusmos
Copy link
Author

giusmos commented Oct 28, 2022

Thanks. I guess I can only wait at the moment, there is not yet a patch available, right?

@dirkf
Copy link
Contributor

dirkf commented Oct 28, 2022

We know what the patch is but there isn't a patched yt-dl release.

If you install yt-dl using pip, the extractor modules will be installed somewhere on your disk. Then you can replace the extractor/la7.py module as above, after applying the 1-line change as linked. You may need to be admin to do that. Or you can wait for yt-dlp to be updated. Or in due course there will be a yt-dl PR that should be rolled into a release.

@giusmos
Copy link
Author

giusmos commented Oct 28, 2022

I have installed it now using pip as you suggested, but also in this case I don't get the folder you mention, I only get a youtube-dl file in the folder "/usr/local/bin".

@dirkf
Copy link
Contributor

dirkf commented Oct 28, 2022

If you run the yt-dl instance installed with pip as in your original post, it should give you some output that will show where the files are installed. In that case there was this line:

  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 906, in _parse_json

You might instead see

  File "/usr/lib/python3.10/site-packages/youtube_dl/extractor/common.py", line 906, in _parse_json

or maybe ~/.local/lib/... or /usr/local/lib/..., depending on how pip was run.

@giusmos
Copy link
Author

giusmos commented Oct 29, 2022

Thanks a lot for your support. I have replaced the la7.py file in the path you mentioned. This time I don´t get anymore the JSON error but I get the error of "no video formats found", see below:

youtube-dl --verbose --no-playlist -o "%(title)s.%(ext)s" https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '--no-playlist', '-o', '%(title)s.%(ext)s', 'https://www.la7.it/piazzapulita/rivedila7/piazzapulita-puntata-del-13102022-14-10-2022-455682']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.10.6 (CPython) - Linux-5.19.0-76051900-generic-x86_64-with-glibc2.35
[debug] exe versions: none
[debug] Proxy map: {}
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading webpage
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading MPD manifest
WARNING: Failed to download MPD manifest: HTTP Error 413: Request Entity Too Large
[la7.it] piazzapulita-puntata-del-13102022-14-10-2022-455682: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 413: Request Entity Too Large
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/YoutubeDL.py", line 836, in __extract_info
ie_result = ie.extract(url)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/extractor/common.py", line 534, in extract
ie_result = self._real_extract(url)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/extractor/la7.py", line 100, in _real_extract
self._sort_formats(formats)
File "/usr/local/lib/python3.10/dist-packages/youtube_dl/extractor/common.py", line 1374, in _sort_formats
raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@dirkf
Copy link
Contributor

dirkf commented Oct 29, 2022

Did you also make the change from yt-dlp/yt-dlp#5360 (comment)?

The surrounding lines in the diff shown there may be slightly different but the pattern to be changed is the same.

@giusmos
Copy link
Author

giusmos commented Oct 29, 2022

That worked! Now I could download the video from la7.it

Thanks really a lot for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken-IE problem with existing site extraction patch-available
Projects
None yet
Development

No branches or pull requests

2 participants