Giter Club home page Giter Club logo

Comments (6)

glumia avatar glumia commented on August 10, 2024 1

Script updated, check if It works now and let me know.

Yes, the script needs a browser, you can see what happens in background using the '--no-headless' option with the new version.
Honestly I don't know, It should work also on a server without a graphical interface.

from openload_dl.

glumia avatar glumia commented on August 10, 2024

Hi!
On which OS are you running the script?

from openload_dl.

NormanBB avatar NormanBB commented on August 10, 2024

I may give you a example.

First of all ,my environment is as follows.

(Session info: headless chrome=70.0.3538.67) (Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.16299 x86_64)

My download link is https://openload.co/f/JP_Z7IDpyKU/0209.%E5%8F%8C%E6%88%AA%E6%A3%8D.mp3

And i get this.

openload-dl:36: DeprecationWarning: use options instead of chrome_options with webdriver.Chrome(chrome_options=chrome_opt) as browser: [1123/230706.332:ERROR:gpu_process_transport_factory.cc(980)] Lost UI shared context. DevTools listening on ws://127.0.0.1:3085/devtools/browser/e0c00e1d-fca0-46a9-94cd-36e02e21ea07 [1123/230711.090:INFO:CONSOLE(81)] "A parser-blocking, cross site (i.e. different eTLD+1) script, https://uod2quk646.com/a4a81342d44754d915ef43ea77312574/invoke.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.", source: https://openload.co/f/JP_Z7IDpyKU/0209.%E5%8F%8C%E6%88%AA%E6%A3%8D.mp3 (81) [1123/230711.091:INFO:CONSOLE(81)] "A parser-blocking, cross site (i.e. different eTLD+1) script, https://uod2quk646.com/a4a81342d44754d915ef43ea77312574/invoke.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.", source: https://openload.co/f/JP_Z7IDpyKU/0209.%E5%8F%8C%E6%88%AA%E6%A3%8D.mp3 (81) Extracting download link for test.mp3 [1123/230819.727:WARNING:http_cache_transaction.cc(2384)] Byte ranges AND validation headers found. [1123/231226.653:WARNING:http_cache_transaction.cc(2384)] Byte ranges AND validation headers found. Download of test.mp3 in progress... [1123/231227.247:WARNING:http_cache_transaction.cc(2384)] Byte ranges AND validation headers found. [1123/231227.510:WARNING:http_cache_transaction.cc(2384)] Byte ranges AND validation headers found. [1123/231231.175:INFO:CONSOLE(221)] "[object Object]", source: https://openload.co/f/JP_Z7IDpyKU/0209.%E5%8F%8C%E6%88%AA%E6%A3%8D.mp3 (221) Traceback (most recent call last): File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\response.py", line 360, in _error_catcher yield File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\response.py", line 442, in read data = self._fp.read(amt) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 447, in read n = self.readinto(b) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 491, in readinto n = self.fp.readinto(b) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", line 1052, in recv_into return self.read(nbytes, buffer) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", line 911, in read return self._sslobj.read(len, buffer) ConnectionResetError: [WinError 10054] The remote host forcibly closed an existing connection。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 750, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\response.py", line 494, in stream data = self.read(amt=amt, decode_content=decode_content) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\response.py", line 459, in read raise IncompleteRead(self._fp_bytes_read, self.length_remaining) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\response.py", line 378, in _error_catcher raise ProtocolError('Connection broken: %r' % e, e) urllib3.exceptions.ProtocolError: ("Connection broken: ConnectionResetError(10054, 'The remote host forcibly closed an existing connection 。', None, 10054, None)", ConnectionResetError(10054, 'The remote host forcibly closed an existing connection。', None, 10054, None)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "openload-dl", line 75, in <module> fp.write(requests.get(downloadurl,headers=mozilla_header).content) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, **kwargs) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in send history = [resp for resp in gen] if allow_redirects else [] File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in <listcomp> history = [resp for resp in gen] if allow_redirects else [] File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 247, in resolve_redirects **adapter_kwargs File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 686, in send r.content File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 828, in content self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b'' File "C:\Users\N\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 753, in generate raise ChunkedEncodingError(e) requests.exceptions.ChunkedEncodingError: ("Connection broken: ConnectionResetError(10054, 'The remote host forcibly closed an existing connection。', None, 10054, None)", ConnectionResetError(10054, 'The remote host forcibly closed an existing connection。', None, 10054, None))

I put the log in one txt.

log.txt

Hopefully this would help you. @gius-italy

from openload_dl.

glumia avatar glumia commented on August 10, 2024

Hi NormanBB,
on my Windows environment ( {'acceptInsecureCerts': True, 'browserName': 'firefox', 'browserVersion': '63.0.3', 'moz:accessibilityChecks': False, 'moz:geckodriverVersion': '0.23.0', 'moz:headless': True, 'moz:useNonSpecCompliantPointerOrigin': False, 'moz:webdriverClick': True, 'pageLoadStrategy': 'normal', 'platformName': 'windows', 'platformVersion': '10.0', 'rotatable': False, 'setWindowRect': True, 'timeouts': {'implicit': 0, 'pageLoad': 300000, 'script': 30000}, 'unhandledPromptBehavior': 'dismiss and notify'} ) everything works fine, but it looks like the problem is with the piece of code at lines 74 and 75.

I'm working on a new version of the script with different download handling and other features like download url extraction, maybe everything will be fixed with the next release.

As a temporary fix you can try to edit lines 74 and 75 to just print the direct url and then download the file with your browser or a downloader like jdownloader.

If the issue will persist even with the new version then we will dig deeper to find out what's the problem.

from openload_dl.

NormanBB avatar NormanBB commented on August 10, 2024

Waiting for the new version.

I have a small question.The script need a browser,but do not need to really open it.Right?Which means if the script works well,it could be used on the server which only has terminal?

from openload_dl.

glumia avatar glumia commented on August 10, 2024

NormanBB reported that the script now works without problems on Windows environments.

from openload_dl.

Related Issues (8)

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.