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] raise IncompleteRead(data, amt-len(data)) #1909

Open
deepakbharti-38 opened this issue Apr 8, 2024 · 1 comment
Open

[BUG] raise IncompleteRead(data, amt-len(data)) #1909

deepakbharti-38 opened this issue Apr 8, 2024 · 1 comment
Labels

Comments

@deepakbharti-38
Copy link

deepakbharti-38 commented Apr 8, 2024

while downloading all videos in the playlist - https://www.youtube.com/playlist?list=PLgF7lRh8Xb_X6vMQiT9hy4OGGRASX0hXc
following error occurs after downloading 28th or 29th video in the list.

Describe the bug
After downloading first 28 video in the playlist error occured

To Reproduce
Please provide the following information:

  • [The playlist url that is causing the error -(https://www.youtube.com/playlist?list=PLgF7lRh8Xb_X6vMQiT9hy4OGGRASX0hXc)
  • The code where the problem is occurring. -
    playlist = Playlist(url)
    for video in playlist.videos:
    if video.title in video_list:
    print(f"{video.title} Already Downloaded")
    else:
    print(f"Downloading Video: {video.title}")
    download_mthd()
    print(f"Downloaded Video: {video.title}")
    download_button.config(text="download completed")
    print("Download Completed")

def download_mthd():
global video
video.streams.get_highest_resolution().download(download_directory)
time.sleep(1)

Expected behavior
I have tested another playlist with 200 video in it. It worked fine. The length of the video were within 20min.
The length of the video in the playlist giving error are 1 hr to 1hr 30min max.

Output
raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(1749429 bytes read, 7687755 more expected)

{ File "E:\Documents\Python\Youtube Complete Playlist Downloader\YouTube_Phase7.py", line 93, in download_mthd
video.streams.get_highest_resolution().download(download_directory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pytube\streams.py", line 314, in download
for chunk in request.stream(
File "C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pytube\request.py", line 189, in stream
chunk = response.read()
^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 495, in read
s = self._safe_read(self.length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 642, in _safe_read
raise IncompleteRead(data, amt-len(data))
http.client.IncompleteRead: IncompleteRead(1749429 bytes read, 7687755 more expected) }

System information
Please provide the following information:

  • Python version - Python 3.12.2
  • Pytube version - pytube 15.0.0
  • Command used to install pytube - pip install pytube
Copy link

github-actions bot commented Apr 8, 2024

Thank you for contributing to PyTube. Please remember to reference Contributing.md

@deepakbharti-38 deepakbharti-38 changed the title [BUG] [BUG] raise IncompleteRead(data, amt-len(data)) Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant