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

[BUG] Code crashing when a download is not available #21

Closed
TrackLab opened this issue Oct 6, 2023 · 3 comments
Closed

[BUG] Code crashing when a download is not available #21

TrackLab opened this issue Oct 6, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TrackLab
Copy link

TrackLab commented Oct 6, 2023

Describe the bug:
So, when VEO has a video not available due to maintenance mode or whatever, the code crashes.

Steps to Reproduce the bug:
Download a series, if a video is not available by VOE, the code cant handle it

Expected behavior:
A NoneType Attribute Error is thrown and the code stops

Additional Info
A quick way to fix it, which I quickly implemented myself:
Give the find_cache_url function in search_for_links.py a try/except for the provider check. Like so:

    try:
        if provider == "Vidoza":
            soup = BeautifulSoup(html_page, features="html.parser")
            cache_link = soup.find("source").get("src")
        elif provider == "VOE":
            cache_link = VOE_PATTERN.search(html_page.read().decode('utf-8')).group("url")
        elif provider == "Streamtape":
            cache_link = STREAMTAPE_PATTERN.search(html_page.read().decode('utf-8'))
            if cache_link is None:
                return find_cache_url(url, provider)
            cache_link = "https://" + provider + ".com/" + cache_link.group()[:-1]
            logger.debug(MODULE_LOGGER_HEAD + f"This is the found video link of {provider}: {cache_link}")
    except:
        return None

And then use that returned None in the start_app.py Mainfunction, to check if the returned cache_url is None. If it is not, initiate the download. if it is none, print a statement, to inform the user which season/episode could not be downloaded. Like so:

if cache_url is not None:
                    create_new_download_thread(cache_url, file_name, provider)
                else:
                    print(f"COULD NOT DOWNLOAD! Season: {season} Episode {episode}")

The code can then simply continue onto the text episode.

I can fork the project and implement the fix myself if you want.

@TrackLab TrackLab added the bug Something isn't working label Oct 6, 2023
@wolfswolke
Copy link
Owner

@TrackLab sorry for the late response.
I implemented a code to "fix" this. Does this only happen when vidoza has maintenance? Or are there any animes where you know it happens all the time?

wolfswolke added a commit that referenced this issue Oct 13, 2023
…or errors when finding it. See issue #21 for more info.
@wolfswolke
Copy link
Owner

Issue should be resolved with latest Release. Please try again and open another Issue if its not. Thank you for bringing this to my attention.

@TrackLab
Copy link
Author

@TrackLab sorry for the late response. I implemented a code to "fix" this. Does this only happen when vidoza has maintenance? Or are there any animes where you know it happens all the time?

it was when VOE is in maintenance mode, since that was the first attempt by the software.
Oh also, you have a typo in your logging. In the "please download manually later". it says "please download manly later"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants