Code Monkey home page Code Monkey logo

youtube-downloader's People

Contributors

rahulnegi20 avatar shubham1710 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

youtube-downloader's Issues

Not working, facing error

Desktop % python3 down.py
Enter the number of youtube videos to download: 1

Enter all the links one per line:
https://www.youtube.com/shorts/UVD3mlL3Fxg
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/wathikahmed/Desktop/down.py", line 24, in
yt = YouTube(link)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/main.py", line 91, in init
self.prefetch()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/main.py", line 162, in prefetch
self.watch_html = request.get(url=self.watch_url)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/request.py", line 36, in get
return _execute_request(url).read().decode("utf-8")
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/request.py", line 24, in _execute_request
return urlopen(request) # nosec
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

pytube.exceptions.RegexMatchError

import ytdownload as y
v = y.download_yt()

Title: Srivalli (Audio) | Pushpa | Allu Arjun, Rashmika Mandanna | Javed Ali | DSP | Sukumar
Number of views: 6925230
Length of video: 224
Rating of video: None
Traceback (most recent call last):
File "C:\Users\Vicky\AppData\Local\Programs\Python\Python39\lib\site-packages\pytube_main_.py", line 177, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "C:\Users\Vicky\AppData\Local\Programs\Python\Python39\lib\site-packages\pytube\extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "C:\Users\Vicky\AppData\Local\Programs\Python\Python39\lib\site-packages\pytube\cipher.py", line 33, in init
raise RegexMatchError(
pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W

'NoneType' object has no attribute 'download'

Getting this error while downloading:

Enter the number of youtube videos to download:   1

Enter all the links one per line:
https://www.youtube.com/watch?v=W93XyXHI8Nw

Details for Video 1 

Title of video:    Is Civilization on the Brink of Collapse?
Number of views:   7303133
Length of video:   693 seconds

All available options for downloads:

1) itag="17" and res="144p"
2) itag="18" and res="360p"
3) itag="22" and res="720p"

Enter the itag of your preferred stream to download:   3

Downloading...
Traceback (most recent call last):
  File "/home/coder/project/pypi/code.py", line 46, in <module>
    ys.download()
AttributeError: 'NoneType' object has no attribute 'download'

#DOWNLOAD ERROR!!!

SIR, HELP ME PLEASE!!!

PS C:\Users\ADMIN\Desktop\Youtube-downloader> python code.py
Enter the number of youtube videos to download: 1

Enter all the links one per line:
https://www.youtube.com/watch?v=wzpjnFQ030M&ab_channel=LinkVegas
Traceback (most recent call last):
File "C:\Users\ADMIN\Desktop\Youtube-downloader\code.py", line 20, in
yt = YouTube(link)
File "C:\Python39\lib\site-packages\pytube_main_.py", line 91, in init
self.prefetch()
File "C:\Python39\lib\site-packages\pytube_main_.py", line 181, in prefetch
self.vid_info_raw = request.get(self.vid_info_url)
File "C:\Python39\lib\site-packages\pytube\request.py", line 36, in get
return _execute_request(url).read().decode("utf-8")
File "C:\Python39\lib\site-packages\pytube\request.py", line 24, in _execute_request
return urlopen(request) # nosec
File "C:\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Python39\lib\urllib\request.py", line 555, in error
result = self._call_chain(*args)
File "C:\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Python39\lib\urllib\request.py", line 747, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "C:\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone

Program chrashes? Somehow i get this error

I got pytube installed.

Enter the number of youtube videos to download:   1

Enter all the links one per line:
https://youtu.be/hGIW2fDb0jg
Traceback (most recent call last):
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\YoutubeDownloaders\python3downloader.py", line 15, in <module>
    yt = YouTube(link)
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\__main__.py", line 91, in __init__
    self.prefetch()
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
    raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns

Process finished with exit code 1

Edit: I tried with another youtube link also, I dont know if i am missing a lib?

Download location

Hello, I was checking out your code and downloaded a YouTube video but I can't seem to find where it downloads too. I am on a Mac if that help. Thanks

Download by Res

How to Download videos by resolution
can we use get_by_res() .
when I use get_by_res(),
AttributeError: 'StreamQuery' object has no attribute 'get_by_res'
this error occurs....

ValueError: too many values to unpack (expected 2)

I have paste the video link... while processing the link .it will return A value error like this how to fix this
I reinstall the package too but still this error returns ...
**Traceback (most recent call last):
File "abc.py", line 3, in
you=YouTube(link)
File "/usr/local/lib/python3.8/dist-packages/pytube/main.py", line 92, in init
self.descramble()
File "/usr/local/lib/python3.8/dist-packages/pytube/main.py", line 140, in descramble
apply_signature(self.player_config_args, fmt, self.js)
File "/usr/local/lib/python3.8/dist-packages/pytube/extract.py", line 225, in apply_signature
cipher = Cipher(js=js)
File "/usr/local/lib/python3.8/dist-packages/pytube/cipher.py", line 31, in init
var, _ = self.transform_plan[0].split(".")
ValueError: too many values to unpack (expected 2)
pytuberror
**

File overwritten if exists

This is a great script, the one problem I'm having is if a file already exists with that name in the output folder it gets overwritten. Could there be an option to append a number to the end or to somehow generate a unique filename in these cases?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.