hitsomeshots / hits-link-generator

Turns your datanodes.to links to the download links yoiu can use in download managers!
22 stars 2 forks source link

Some AttributeError #2

Closed Naymmmm closed 4 months ago

Naymmmm commented 5 months ago

I'm running Windows 11 with Python 3.12; I keep getting an AttributeError for get. Here's my full console log.

PS C:\Users\Naymmm\Documents> git clone https://github.com/hitsomeshots/datanodes-link-generator.git
Cloning into 'datanodes-link-generator'...
remote: Enumerating objects: 34, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 34 (delta 10), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (34/34), 13.96 KiB | 1.55 MiB/s, done.
Resolving deltas: 100% (10/10), done.
PS C:\Users\Naymmm\Documents> cd datano*
PS C:\Users\Naymmm\Documents\datanodes-link-generator> ls

    Directory: C:\Users\Naymmm\Documents\datanodes-link-generator

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/06/2024  8:18 PM           4466 gen.py
-a---           8/06/2024  8:18 PM            222 install_dependencies.bat
-a---           8/06/2024  8:18 PM            182 README.md

PS C:\Users\Naymmm\Documents\datanodes-link-generator> .
ParserError:
Line |
   1 |  .
     |  ~
     | Missing expression after '.' in pipeline element.
PS C:\Users\Naymmm\Documents\datanodes-link-generator> .\install_dep*
Requirement already satisfied: aiohttp in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (3.9.5)
Requirement already satisfied: aiosignal>=1.1.2 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from aiohttp) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from aiohttp) (23.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from aiohttp) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from aiohttp) (6.0.5)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from aiohttp) (1.9.4)
Requirement already satisfied: idna>=2.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from yarl<2.0,>=1.0->aiohttp) (3.6)
Installation successful.
Deleting this script...
The batch file cannot be found.
PS C:\Users\Naymmm\Documents\datanodes-link-generator> nvim links.txt
PS C:\Users\Naymmm\Documents\datanodes-link-generator> ls

    Directory: C:\Users\Naymmm\Documents\datanodes-link-generator

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/06/2024  8:18 PM           4466 gen.py
-a---           8/06/2024  8:19 PM          10560 links.txt
-a---           8/06/2024  8:18 PM            182 README.md

PS C:\Users\Naymmm\Documents\datanodes-link-generator> py gen.py
Traceback (most recent call last):
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 8, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
PS C:\Users\Naymmm\Documents\datanodes-link-generator> pip install bs4
Collecting bs4
  Downloading bs4-0.0.2-py2.py3-none-any.whl.metadata (411 bytes)
Collecting beautifulsoup4 (from bs4)
  Downloading beautifulsoup4-4.12.3-py3-none-any.whl.metadata (3.8 kB)
Collecting soupsieve>1.2 (from beautifulsoup4->bs4)
  Downloading soupsieve-2.5-py3-none-any.whl.metadata (4.7 kB)
Downloading bs4-0.0.2-py2.py3-none-any.whl (1.2 kB)
Downloading beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 147.9/147.9 kB 2.2 MB/s eta 0:00:00
Downloading soupsieve-2.5-py3-none-any.whl (36 kB)
Installing collected packages: soupsieve, beautifulsoup4, bs4
Successfully installed beautifulsoup4-4.12.3 bs4-0.0.2 soupsieve-2.5
PS C:\Users\Naymmm\Documents\datanodes-link-generator> ls

    Directory: C:\Users\Naymmm\Documents\datanodes-link-generator

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           8/06/2024  8:18 PM           4466 gen.py
-a---           8/06/2024  8:19 PM          10560 links.txt
-a---           8/06/2024  8:18 PM            182 README.md

PS C:\Users\Naymmm\Documents\datanodes-link-generator> py gen.py
Traceback (most recent call last):
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 9, in <module>
    from pypasser import reCaptchaV3
ModuleNotFoundError: No module named 'pypasser'
PS C:\Users\Naymmm\Documents\datanodes-link-generator> pip install pypasser
Collecting pypasser
  Downloading PyPasser-0.0.5.tar.gz (10 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: requests<3.0,>=2.25.1 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from pypasser) (2.31.0)
Collecting PySocks==1.7.1 (from pypasser)
  Downloading PySocks-1.7.1-py3-none-any.whl.metadata (13 kB)
Collecting SpeechRecognition==3.8.1 (from pypasser)
  Downloading SpeechRecognition-3.8.1-py2.py3-none-any.whl.metadata (28 kB)
Collecting pydub==0.25.1 (from pypasser)
  Downloading pydub-0.25.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting selenium (from pypasser)
  Downloading selenium-4.21.0-py3-none-any.whl.metadata (6.9 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from requests<3.0,>=2.25.1->pypasser) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from requests<3.0,>=2.25.1->pypasser) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from requests<3.0,>=2.25.1->pypasser) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from requests<3.0,>=2.25.1->pypasser) (2024.2.2)
Collecting trio~=0.17 (from selenium->pypasser)
  Downloading trio-0.25.1-py3-none-any.whl.metadata (8.7 kB)
Collecting trio-websocket~=0.9 (from selenium->pypasser)
  Downloading trio_websocket-0.11.1-py3-none-any.whl.metadata (4.7 kB)
Collecting typing_extensions>=4.9.0 (from selenium->pypasser)
  Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Requirement already satisfied: attrs>=23.2.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from trio~=0.17->selenium->pypasser) (23.2.0)
Collecting sortedcontainers (from trio~=0.17->selenium->pypasser)
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl.metadata (10 kB)
Collecting outcome (from trio~=0.17->selenium->pypasser)
  Downloading outcome-1.3.0.post0-py2.py3-none-any.whl.metadata (2.6 kB)
Requirement already satisfied: sniffio>=1.3.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from trio~=0.17->selenium->pypasser) (1.3.1)
Requirement already satisfied: cffi>=1.14 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from trio~=0.17->selenium->pypasser) (1.16.0)
Requirement already satisfied: wsproto>=0.14 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from trio-websocket~=0.9->selenium->pypasser) (1.2.0)
Requirement already satisfied: pycparser in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from cffi>=1.14->trio~=0.17->selenium->pypasser) (2.22)
Requirement already satisfied: h11<1,>=0.9.0 in c:\users\naymmm\appdata\local\programs\python\python312\lib\site-packages (from wsproto>=0.14->trio-websocket~=0.9->selenium->pypasser) (0.14.0)
Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Downloading SpeechRecognition-3.8.1-py2.py3-none-any.whl (32.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 32.8/32.8 MB 10.6 MB/s eta 0:00:00
Downloading selenium-4.21.0-py3-none-any.whl (9.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 12.9 MB/s eta 0:00:00
Downloading trio-0.25.1-py3-none-any.whl (467 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 467.7/467.7 kB 9.7 MB/s eta 0:00:00
Downloading trio_websocket-0.11.1-py3-none-any.whl (17 kB)
Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Downloading outcome-1.3.0.post0-py2.py3-none-any.whl (10 kB)
Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Building wheels for collected packages: pypasser
  Building wheel for pypasser (pyproject.toml) ... done
  Created wheel for pypasser: filename=PyPasser-0.0.5-py3-none-any.whl size=11696 sha256=80237c75725ed9cd81866b998ec09b3efa62c1878351a25a027af634a6d290bf
  Stored in directory: c:\users\naymmm\appdata\local\pip\cache\wheels\5b\ac\ab\9fb66af8e3d444e27227043b5bb5bedc1fde551464b5e6b3a8
Successfully built pypasser
Installing collected packages: SpeechRecognition, sortedcontainers, pydub, typing_extensions, PySocks, outcome, trio, trio-websocket, selenium, pypasser
Successfully installed PySocks-1.7.1 SpeechRecognition-3.8.1 outcome-1.3.0.post0 pydub-0.25.1 pypasser-0.0.5 selenium-4.21.0 sortedcontainers-2.4.0 trio-0.25.1 trio-websocket-0.11.1 typing_extensions-4.12.2
PS C:\Users\Naymmm\Documents\datanodes-link-generator> py genp.py
C:\Users\Naymmm\AppData\Local\Programs\Python\Python312\python.exe: can't open file 'C:\\Users\\Naymmm\\Documents\\datanodes-link-generator\\genp.py': [Errno 2] No such file or directory
PS C:\Users\Naymmm\Documents\datanodes-link-generator> py gen.py
C:\Users\Naymmm\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 124, in <module>
    download_links = asyncio.run(process_links(urls))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 685, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 110, in process_links
    download_link = await get_download_link(session, url)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 70, in get_download_link
    rand_value = await get_rand_value(session, file_code, file_name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naymmm\Documents\datanodes-link-generator\gen.py", line 60, in get_rand_value
    return download_tag.get("rand")
           ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
PS C:\Users\Naymmm\Documents\datanodes-link-generator>
hitsomeshots commented 5 months ago

Hey I am aware of this issue, recently datanodes added a captcha and another value that’s different for each download i managed to get the value needed but i have to find a way to get the captcha link every time until then it woll be broken

Eyepan commented 4 months ago

hey @hitsomeshots, i tried commenting out the get_captcha_response function and it seemed to work properly. I had to remove the calls to the function and the key-value pair in the payload variable as well but it seemed to work!

Naymmmm commented 4 months ago

hey @hitsomeshots, i tried commenting out the get_captcha_response function and it seemed to work properly. I had to remove the calls to the function and the key-value pair in the payload variable as well but it seemed to work!

Mind forking and opening a PR?

Eyepan commented 4 months ago

hey @hitsomeshots, i tried commenting out the get_captcha_response function and it seemed to work properly. I had to remove the calls to the function and the key-value pair in the payload variable as well but it seemed to work!

Mind forking and opening a PR?

will do as soon as I get home, at work rn.

hitsomeshots commented 4 months ago

hey @hitsomeshots, i tried commenting out the get_captcha_response function and it seemed to work properly. I had to remove the calls to the function and the key-value pair in the payload variable as well but it seemed to work!

Mind forking and opening a PR?

will do as soon as I get home, at work rn.

If you could do this I can merge it with the main branch

hitsomeshots commented 4 months ago

Fixed issue, generator working again will close this.