hcjohn463 / JableTVDownload

下載 jable好幫手
Apache License 2.0
665 stars 149 forks source link

urllib.error.HTTPError: HTTP Error 403: Forbidden #86

Open Topbcy opened 1 year ago

Topbcy commented 1 year ago

正在下載影片: https://jable.tv/videos/salo-017/ Traceback (most recent call last): File "I:\JableTVDownload-allow-multilple-download-from-model-page\main.py", line 35, in download(url) File "I:\JableTVDownload-allow-multilple-download-from-model-page\download.py", line 39, in download urllib.request.urlretrieve(m3u8url, m3u8file) File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 563, in error return self._call_chain(args) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain result = func(args) ^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

請問有辦法解決嗎~

Calvin-830 commented 1 year ago

add -headers "referer: http://jable.tv"

IntangibleW commented 1 year ago

add -headers "referer: http://jable.tv"

still don't understand

Calvin-830 commented 1 year ago

main.py modify opener = urllib.request.build_opener() opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'), ('Referer', 'https://jable.tv')] urllib.request.install_opener(opener) urllib.request.urlretrieve(m3u8url, m3u8file)

config.py add 'referer' : 'https://jable.tv'

shiverman commented 1 year ago

main.py modify opener = urllib.request.build_opener() opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'), ('Referer', 'https://jable.tv')] urllib.request.install_opener(opener) urllib.request.urlretrieve(m3u8url, m3u8file)

config.py add 'referer' : 'https://jable.tv'

it works.

Topbcy commented 1 year ago

still dont understand. how make it work ?

please more detail ~~~

Calvin-830 commented 1 year ago

Please checkout https://github.com/Calvin-830/JableTVDownload

Topbcy commented 1 year ago

thank you sir . it work ~~~~

Topbcy commented 1 year ago

hello sir . i got new issue could you try download belowe video link? https://jable.tv/videos/docp-237/

Traceback (most recent call last): File "I:\JableTVDownload-allow-multilple-download-from-model-page\main.py", line 39, in download(url) File "I:\JableTVDownload-allow-multilple-download-from-model-page\download.py", line 42, in download urllib.request.urlretrieve(m3u8url, m3u8file) File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 563, in error return self._call_chain(args) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain result = func(args) ^^^^^^^^^^^ File "C:\Users\Bcy\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 428: