Pytube hata veriyor

EfeHizm

Decapat
Katılım
19 Temmuz 2021
Mesajlar
124
Daha fazla  
Cinsiyet
Erkek
Arkadaşlar PyQt5 daha yeni öğrendim tam olarak öğrenemedim fakat PyQt5 ile bir sıkıntı çıkmadı fakat line edite link bırakım push buttona basıyorum 2 3 saniye bir şey olmuyor ondan sonra kapanıyor ve uzun bir hata veriyor. Nerede yanlışlık var çözemedim.

Kod:
from PyQt5.QtWidgets import *

import sys

from PyQt5.QtCore import *

from pytube import YouTube

class Pencere(QWidget):

    def __init__(self):

        super().__init__()

        self.resize(QSize(480,300))

        self.setMaximumSize(480,300)

        self.setMinimumSize(480,300)

        self.layout=QHBoxLayout()

        self.label=QLabel(self)

        self.label.setText("Youtube\nDownloader")

        self.label.setStyleSheet("color:red; font-weight:bold; font-size:12pt")

        self.lineedit=QLineEdit(self)

        self.lineedit.setText("Lütfen Link giriniz.")

        self.button=QPushButton(self)

        self.button.setText("Tamam")

        self.button.setStyleSheet("color: green")

        self.label2=QLabel(self)

        self.label2.setText("Efehizm")

        self.label2.setStyleSheet("color: red")





        self.layout.addWidget(self.label2)

        self.layout.addWidget(self.lineedit)

        self.layout.addWidget(self.label)

        self.layout.addWidget(self.button)





        self.lineedit.setGeometry(QRect(10,250,350,30))

        self.label.setGeometry(QRect(190,0,100,125))

        self.button.setGeometry(QRect(370,250,100,30))

        self.label2.setGeometry(QRect(425,285,100,10))

  

        self.button.clicked.connect(self.indir)



    def indir(self):

            link= self.lineedit.text()

            YouTube(link).streams.get_highest_resolution().download

          

  















uygulama = QApplication(sys.argv)

pencere = Pencere()

pencere.show()

uygulama.exec_()
 
Son düzenleyen: Moderatör:
Su satirdaki:
Python:
YouTube(link).streams.get_highest_resolution().download
download bir deger degil, fonksiyon. Fonksiyon cagirmak icin func() kullanman lazim. Yani o satiri su sekilde degistir:
Python:
YouTube(link).streams.get_highest_resolution().download()
Baska hata verirse hatayi da at lutfen.
 
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 563, in error
Result = self. _call_chain(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain
Result = func(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 755, in http_error_302
Return self. Parent. Open(New, timeout = req. Timeout)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 531, in open
Response = meth(req, response)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 640, in http_response
Response = self. Parent. Error(
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 569, in error
Return self. _call_chain(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain
Result = func(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 649, in http_error_default
Raise HTTPError(req. Full_url, code, msg, hdrs, fp)
Urllib. Error. HTTPError: HTTP Error 410: Gone
PS C:\Users\efe\Desktop\Çalışma> C: CD 'c:\Users\efe\Desktop\Çalışma'; & 'C:\Users\efe\AppData\Local\Programs\Python\Python38\python.exe' 'c:\Users\efe\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy\launcher' '57213' '--' 'c:\Users\efe\Desktop\Çalışma\main.py'
Traceback (most recent call last):
File "c:\Users\efe\Desktop\Ãal²■ma\main.py", line 48, in download
YouTube(link).streams.get_highest_resolution().download()
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\site-packages\pytube\__main__.py", line 91, in __init__
self.prefetch()
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\site-packages\pytube\__main__.py", line 181, in prefetch
Self. Vid_info_raw = request. Get(self. Vid_info_url)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\site-packages\pytube\request.py", line 36, in get
Return _execute_request(url).read().decode("utf-8")
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\site-packages\pytube\request.py", line 24, in _execute_request
Return urlopen(request) # nosec
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 222, in urlopen
Return opener. Open(URL, data, timeout)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 531, in open
Response = meth(req, response)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 640, in http_response
Response = self. Parent. Error(
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 563, in error
Result = self. _call_chain(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain
Result = func(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 755, in http_error_302
Return self. Parent. Open(New, timeout = req. Timeout)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 531, in open
Response = meth(req, response)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 640, in http_response
Response = self. Parent. Error(
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 569, in error
Return self. _call_chain(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain
Result = func(*args)
File "C:\Users\efe\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 649, in http_error_default
Raise HTTPError(req. Full_url, code, msg, hdrs, fp)
Urllib. Error. HTTPError: HTTP Error 410: Gone

Orayı yanlışlıkla silmişim ama önceden de vardı. Yine aynı hata.
pardon kodu nasıl öyle yapıyorsunuz
Arkadaşlar problemi buldum ama çözemedim. Problem pytubenin buglu olmasıymış.
 

Geri
Yukarı