Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audiobook-dl not working for everand #129

Open
Juhayer-Al-Wasif opened this issue Sep 26, 2024 · 2 comments
Open

audiobook-dl not working for everand #129

Juhayer-Al-Wasif opened this issue Sep 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Juhayer-Al-Wasif
Copy link

Command: pipx install --force audiobook-dl
Output:

Installing to existing venv 'audiobook-dl'
⚠️  Note: audiobook-dl was already on your PATH at /usr/bin/audiobook-dl
  installed package audiobook-dl 0.7.3, installed using Python 3.12.6
  These apps are now globally available
    - audiobook-dl
done! ✨ 🌟 ✨

~ took 7s
Command: audiobook-dl -c /home/wasif/Desktop/cookies-everand-com.txt https://www.everand.com/book/163636556/American-Gods-The-Tenth-Anniversary-Edition-A-Novel
Output:

Finding compatible source
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/__main__.py", line 33, in main
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/__main__.py", line 50, in process_url
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/sources/__init__.py", line 28, in find_compatible_source
audiobookdl.exceptions.NoSourceFound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/audiobook-dl", line 33, in <module>
    sys.exit(load_entry_point('audiobook-dl==0.7.3', 'console_scripts', 'audiobook-dl')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/__main__.py", line 35, in main
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/exceptions.py", line 33, in print
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/logging.py", line 50, in print_error_file
  File "/usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/utils/__init__.py", line 37, in read_asset_file
  File "/usr/lib/python3.12/zipfile/_path/__init__.py", line 342, in read_text
    with self.open('r', encoding, *args, **kwargs) as strm:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/zipfile/_path/__init__.py", line 307, in open
    raise FileNotFoundError(self)
FileNotFoundError: /usr/lib/python3.12/site-packages/audiobook_dl-0.7.3-py3.12.egg/audiobookdl/assets/errors/no_source_found.txt
@Juhayer-Al-Wasif Juhayer-Al-Wasif added the bug Something isn't working label Sep 26, 2024
@devnoname120
Copy link
Contributor

devnoname120 commented Oct 6, 2024

Alternative:

  1. Install Widevine L3 Guessor
    • Read the README.md carefully. Among other things you will need to dump a CDM first or it won't work.
  2. Open the audiobook in Everand and start playing.
  3. Click on the Widevine L3 Guessor extension icon.
    1. The PSSH should already be filled, if not then press the Select button.
    2. The License URL should already be filled with https://lic.drmtoday.com/license-proxy-widevine/cenc/?specConform=true. If not, press the Select button and choose it.
    3. Change the Challenge scheme to CommonWV.
    4. Click on Guess!.
    5. The keys will appear in the Result box (one per line). Copy them for later.
  4. Open the Developer Tools of your web browser. In the Network tab search for .mpd and it should show a GET request. Click on it and then on Preview or Response and you should see some XML text.
    • If no requests appear then keep the Developer Tools open and reload the page.
    • Make sure to click on the GET request, not the OPTIONS request or you won't see anything.
  5. Find the <SegmentTimeline> of the bitrate you want, it should contain entries like <S d="123456" r="9876"></S>. Calculate 1 (for segment 96kbps-0.m4s) + the sum the r values in the <S> tags, assuming 1 if an r value is missing. In my case I have two <S> tags: <S d="123456" r="9876"></S> and <S d="65432"></S>. So the sum is 1 + d + 1 = 1 + 9876 + 1 = 9878. Remember that number, it corresponds to the total count of segments that we will need to download in a next step.
  6. Still in the Network tab search for .m4s and it should show some requests in the form of 96kbps-0.m4s, 96kbps-1.m4s, etc. or 128kbps-0.m4s, 128kbps-1.m4s, etc.
    1. Right-click on one of these requests and then Copy as cURL. In the copied command, replace the segment number in the URL with {} and add --output 128kbps-{}.m4s at the end of the command For example in my case I replace 128kbps-1.m4s with 128kbps-{}.m4s in the URL and I add --output 128kbps-{}.m4s at the end of the command.
    2. Run the following bash code to download all the segments (replace 9878 with the sum you calculated above):
    seq 0 9878 | xargs -n 1 -P 20 -I{} [Paste the curl command here] --max-time 10 --connect-timeout 5 --retry-connrefused --retry-delay 0 --retry 5 --retry-max-time 30 --output 128kbps-{}.m4s
    
    1. The segments should have been successfully downloaded. Note that even if the requests in the browser were 96kbps-xxx.m4s you can usually replace the 96kbps with 128kbps in the URL to improve the quality.
  7. To concatenate all the downloaded segments together you can execute it (replace 9878 with the sum you calculated before):
seq 0 9878 | xargs -n 1 -P 1 -I{} cat 128kbps-{}.m4s >> 128kbps-concat.m4b
  1. Install Bento4 (we need its mp4decrypt command).
  2. Decrypt the concatenated file. Put a --key argument for each key that appeared in the Result box of the Widevine L3 Guessor extension. For example:
mp4decrypt --show-progress --key xxxxxxxxxxxxxx:xxxxxxxxxxxx --key xxxxxxxxxxxxxx:xxxxxxxxxxxx --key [etc.] 128kbps-concat.m4b 128kbps-decrypt.m4b
  1. You should now be able to play 128kbps-decrypt.m4b without issues.
  2. (Optional) You can use something like https://github.com/sandreas/m4b-tool to e.g. fix the chapters if needed:
m4b-tool chapters --adjust-by-silence -o 128kbps-decrypt-chapters.m4b 128kbps-decrypt.m4b

@williamcorney
Copy link

williamcorney commented Nov 24, 2024

i just wanted to add my two pence worth for anyone else. You can use N_m3u8dl-RE!

  1. Generate the N_m3u8dl-re command with stream doctor
  2. Add the auth headers from "Copy as Curl" for the MPD. It seems this changes per mpd.
  3. Add the keys from WV3 Guesser to the N_m3u8dl-RE command

If in doubt you can get chatgpt to amend the N_m3u8dl-RE command and insert the headers/keys for you.

Credit to @devnoname120 without whose work wouldnt have been possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants