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

Exception video unavailable #273

Open
limFakson opened this issue Oct 10, 2024 · 2 comments
Open

Exception video unavailable #273

limFakson opened this issue Oct 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@limFakson
Copy link

❗ DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE ❗

lack of information will lead to closure of the issue


Describe the bug
A clear and concise description of what the bug is.
"error": "Video unavailable or not found


code that was used that resulted in the bug

from pytubefix import YouTube

# put your code here
streams = yt.streams.filter(
                res=self.quality,
                file_extension=self.file_type,
                progressive=self.pros,
            )
            stream_list = []

            if streams is None:
                return None

            for stream in streams:
                # download_link = stream.url
                # r = requests.get(download_link, allow_redirects=True)
                # open(stream.default_filename, "wb").write(r.content)
                stream_list.append(
                    {
                        "filename": stream.default_filename,
                        "resolution": f"{stream.width} X {stream.height}",
                        "quality": stream.resolution,
                        "filesize": stream.filesize_mb,
                        "mime_type": stream.mime_type,
                        "file_ext": stream.subtype,
                        "thumbnail": self.thumbnail,
                        "url": stream.url,
                    }
                )

            return stream_list
        except VideoUnavailable:
            err_msg = {"error": "Video unavailable or not found, try again"}
            return err_msg
        except URLError:
            err_msg = {"error": "Network error try again"}
            return err_msg

Expected behavior
A clear and concise description of what you expected to happen.


Screenshots
If applicable, add screenshots to help explain your problem.
image


Desktop (please complete the following information):

  • OS: [Your Operating System and Version]
  • Python Version [x.y.z]
  • Pytubefix Version [x.y.z]

Additional context
Add any other context about the problem here.

@limFakson limFakson added the bug Something isn't working label Oct 10, 2024
@jhanley-com
Copy link

The error appears to be HTTP 400 reported by your proxy/app. The error does not appear to be from YouTube.

Note: my code can download the URL. That is a strong indicator that the problem is with your design and not with PyTubeFix.

@limFakson
Copy link
Author

The error appears to be HTTP 400 reported by your proxy/app. The error does not appear to be from YouTube.

Note: my code can download the URL. That is a strong indicator that the problem is with your design and not with PyTubeFix.

what about now?
image

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
Status: waiting
Development

No branches or pull requests

2 participants