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

[Funimation] Update url pattern to include language code #28950

Closed

Conversation

Mevious
Copy link

@Mevious Mevious commented May 2, 2021

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Funimation recently made an update to include the two-letter language code in all urls. This updates the url matching pattern to include these language codes. This fixes #28879 which was closed as a duplicate, but I can't find what it is a duplicate of.

@chrisfu

This comment has been minimized.

@dstftw
Copy link
Collaborator

dstftw commented May 4, 2021

This will break URLs without the lang code.

@Mevious
Copy link
Author

Mevious commented May 4, 2021

URLs without the language code currently do not work. Funimation seems to be in the process of deprecating them. The pages still exist but they do not contain the information that the extractor is looking for. Here's an example:

[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'--skip-download', u'https://www.funimation.com/shows/hacksign/role-play/']
[debug] Encodings: locale cp1252, fs mbcs, out UTF-8, pref cp1252
[debug] youtube-dl version 2021.04.26
[debug] Python version 2.7.17 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg git-2020-04-17-889ad93, ffprobe git-2020-04-17-889ad93
[debug] Proxy map: {}
[Funimation] role-play: Downloading webpage
WARNING: [Funimation] role-play: Failed to parse JSON No JSON object could be decoded
ERROR: Unable to extract al:web:url; 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 "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\extractor\common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\extractor\funimation.py", line 101, in _real_extract
    ], webpage, fatal=True)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\extractor\common.py", line 1142, in _html_search_meta
    html, display_name, fatal=fatal, group='content', **kwargs)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\extractor\common.py", line 1021, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "C:\Users\Nasir\source\repos\youtube-dl-1\youtube_dl\extractor\common.py", line 1012, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract al:web:url; 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.


Process finished with exit code 1

I don't see a good reason to try to rewrite the extractor to fix these old pages which seem to be going away. Another option is to accept both with and without the language code in the URL. If the language code is not present then use a default like en. Would that be more acceptable?

@dstftw
Copy link
Collaborator

dstftw commented May 4, 2021

URLs without lang code work perfectly fine.

@True-King
Copy link

URLs without lang code work perfectly fine.

Wait is Funimation working with YTDL now? if so whats the process

@Mevious
Copy link
Author

Mevious commented May 5, 2021

@True-King Dstftw checked in a fix here. Does it work for you?

@True-King
Copy link

@True-King Dstftw checked in a fix here. Does it work for you?

Hi checked but it doesn't work for me, but question? I have the ytdl.exe do I have to add the funimation.py to the same folder?

@Mevious
Copy link
Author

Mevious commented May 5, 2021

Hi checked but it doesn't work for me, but question? I have the ytdl.exe do I have to add the funimation.py to the same folder?

If you want to use the exe, then you'll need to wait for the next release and download it. The most recent one is from April 26th, so it won't include the fix. I'm not sure how often it gets an update. https://ytdl-org.github.io/youtube-dl/download.html

Alternatively, you can download the full source code here today and use python to run it directly.

@True-King
Copy link

Hi checked but it doesn't work for me, but question? I have the ytdl.exe do I have to add the funimation.py to the same folder?

If you want to use the exe, then you'll need to wait for the next release and download it. The most recent one is from April 26th, so it won't include the fix. I'm not sure how often it gets an update. https://ytdl-org.github.io/youtube-dl/download.html

Alternatively, you can download the full source code here today and use python to run it directly.

Ohh nice I am familiar with Python quite a bit so I couldn't understand why the exe wasn't working lol. Thanks again

@acp21
Copy link

acp21 commented May 7, 2021

@True-King Dstftw checked in a fix here. Does it work for you?

@Mevious Sorry if I'm missing something really obvious, but I cloned the master branch with git and ran main.py and still received the same error in your above post. I double checked funimation.py, ensuring that it had the changes in that PR. is there anything else that I am missing because I really don't understand what is causing this.

@True-King
Copy link

@True-King Dstftw checked in a fix here. Does it work for you?

@Mevious Sorry if I'm missing something really obvious, but I cloned the master branch with git and ran main.py and still received the same error in your above post. I double checked funimation.py, ensuring that it had the changes in that PR. is there anything else that I am missing because I really don't understand what is causing this.

Having same issue

@Mevious
Copy link
Author

Mevious commented May 7, 2021

@Mevious Sorry if I'm missing something really obvious, but I cloned the master branch with git and ran main.py and still received the same error in your above post. I double checked funimation.py, ensuring that it had the changes in that PR. is there anything else that I am missing because I really don't understand what is causing this.

I was never able to get it working without the language code in the URL. If you're trying with a URL like this
https://www.funimation.com/shows/hacksign/role-play/,
then you may need to manually add a language code such as en after the .com like this
https://www.funimation.com/en/shows/hacksign/role-play/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Funimation fails to parse JSON
5 participants