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

Enter with your visitorData: An error has occurred: EOF when reading a line #292

Open
TSxSAHIL opened this issue Oct 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

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

You can use the tool: https://github.com/YunzheZJU/youtube-po-token-generator, to get the token
Enter with your visitorData: An error has occurred: EOF when reading a line
127.0.0.1 - - [20/Oct/2024:12:36:51 +0000] "POST /transcribe HTTP/1.1" 500 37 "http://localhost:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"

This is the error which I am getting while deploying a yt audio downloader on render


code that was used that resulted in the bug

from pytubefix import YouTube
from pytubefix.cli import on_progress

class VideoCoPilot:
    def __init__(self, url):
        self.url = url
        self.audio_filename = None

    def url_to_audio(self):
        link = self.url
        start_time = time.time()
        try:
            collection_folder = os.path.join(os.getcwd(), "db")
            if not os.path.exists(collection_folder):
                os.makedirs(collection_folder)
                print(f"Collection folder created: {collection_folder}")
            else:
                print(f"Using existing collection folder: {collection_folder}")

            yt = YouTube(link, on_progress_callback=on_progress)
            print(f"Downloading audio for: {yt.title}")

            ys = yt.streams.get_audio_only()
            self.audio_filename = os.path.join(collection_folder, "audio.mp3")

            ys.download(output_path=collection_folder, filename="audio.mp3")
            print(f"Audio downloaded at: {self.audio_filename}")

            elapsed_time = time.time() - start_time
            print(f"Time taken to download audio: {elapsed_time:.2f} seconds")
            return self.audio_filename

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

With this code i wanted a audio from a given youtube link


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


Desktop (please complete the following information):

  • OS: [Windows]
  • Python Version [3.11.8]
  • Pytubefix Version [7.4.0]

Additional context
Add any other context about the problem here.

@TSxSAHIL TSxSAHIL added the bug Something isn't working label Oct 20, 2024
@Hetari
Copy link
Contributor

Hetari commented Oct 23, 2024

Could you please update Pytubefix to the latest version (Pytubefix 8.1.1) by running the following pip command, and check if the error persists?

pip install --upgrade pytubefix

@TSxSAHIL
Copy link
Author

No it does'nt work at all. I am getting the error of "An error has occurred: iE9HMudybyc This request was detected as a bot. Use use_po_token=True to view. See more details at #209"

@TSxSAHIL
Copy link
Author

Hi @Hetari I just want a small project which takes a link and return the audio file to it. As I am learning python and i want to deploy it on render

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