Giter VIP home page Giter VIP logo

audiobook-dl's Introduction

audiobook-dl

GitHub release GitHub top language License Donate using Ko-Fi

CLI tool for downloading audiobooks from online sources.

Supported Services

audiobook-dl currently supports downloading from the following sources:

More info

Installation

audiobook-dl can be installed from the repo itself or through pip.

To get the newest stable version with pip run:

pip install audiobook-dl

If you want to use the newest version (can be unstable) run:

pip install "git+https://github.com/jo1gi/audiobook-dl.git"

or

git clone https://github.com/jo1gi/audiobook-dl.git
cd audiobook-dl
python3 setup.py install

Some features require ffmpeg which can be installed through most package managers or from ffmpeg.org/download.html.

Authentication

Cookies

audiobook-dl uses Netscape cookie files for authentication in most cases. I use this extension to export my cookies from the browser.

Cookies can be placed in current dir as cookies.txt or be given with the --cookie argument.

Login

Some sources support authentication through login with username and password (and sometimes library). Use the --username and --password arguments or enter them through an interactive prompt.

Downloading audiobooks

audiobook-dl -c <cookie file> <url>

Most sites require you to provide the listening page not not just the information page

Arguments

Argument Value
url The url of the page where you listen to the audiobook
-c/--cookie Path to a Netscape cookie file
--combine Combine all output files into a single file (requires ffmpeg)
--cover Only download cover
-d/--debug Print debug information
-o/--output Output location
--remove-chars List of characters that will be removed from output path
--no-chapters Don't include chapters in output file
--output-format Output file format
--verbose--ffmpeg Show ffmpeg output in terminal
--username Username to source (Required when using login)
--password Password to source (Required when using login)
--library Specific library on service (Sometimes required when using login)

Output

By default, audiobook-dl saves all audiobooks to {title} relative to the current path. This can be changed with the --output argument. Path can be customized by audiobook with the following fields:

  • title
  • author
  • series
  • narrator

Not all fields are available for all audiobooks.

The file extension can be changed with the --output-format argument.

Configuration

audiobook-dl can be configured using a configuration file, which should be placed at:

  • Windows: C:\\Users\\$user\\AppData\\Local\\jo1gi\\audiobook-dl\\audiobook-dl.toml
  • Mac: /Users/$user/Library/Application Support/audiobook-dl/audiobook-dl.toml
  • Linux $XDG_CONFIG_DIR/audiobook-dl/audiobook-dl.toml

Authentications

Source credentials can be provided in the configuration file:

[sources.yourcloudlibrary]
username = "yourusername"
password = "supersecretpassword"
library = "hometown"

Cookie files can be specified in a similar way:

[sources.everand]
cookie_file = "./everand_cookies.txt"

Paths are relative to the configuration directory.

Contributions

Issues, bug-reports, pull requests or ideas for features and improvements are very welcome.

Donations

If you like the project, please consider donating:

Cryptocurrencies
  • Bitcoin: bc1qrh8hcnw0fd22y7rmljlmrztwrz2nd5tqckrt44
  • Bitcoin Cash: qp6rt9zx7tfyu9e4alxcn5yf4re5pfztvu8yx0rywh
  • Dash: XfgopGkj4BBpuzsUvrbj9jenXUZ6dXsr3J
  • Etherium: 0x8f5d2eb6d2a4d4615d2b9b1cfa28b4c5b9d18f9f
  • Litecoin: ltc1qfz2936a04m2h7t0srxftygjrq759auav7ndfd3
  • Monero: 853tLAbK5wQ93mdj884C31JGKBUEJCpM25gEjGGLnuVDc8PEDMJi6uC5Vcz9g37K2PeT8FY1bjEveUWqJXNPotFRLwLnn9a

audiobook-dl's People

Contributors

aldowaldo avatar devnoname120 avatar edibegovic avatar freddy36 avatar jo1gi avatar kianmeng avatar lullius avatar martimarkov avatar spectroxx avatar xetera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiobook-dl's Issues

PermissionError

Hello to all and sorry again to bother but I have this problem in downloading this audiobook series :(
It seems that I cannot download titles too long.. is like that? What can I do?
I already downloaded other audiobooks smoothly but I cannot download this serie.
I use Termux in no rooted Tab S8.
Thanks for your support

Ignore URL separator

As we can see from #56 a simple ignoring of the separator "?" would be in order. For some reason also the program couldn't produce proper error message in that issue.

--combine tag results in error

Sorry... one more from me. If I add the --combine tag, I get the following error:

Converting files
Combining files
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 56, in run
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 77, in run_on_url
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 47, in download
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 149, in combined_audiobook
audiobookdl.exceptions.FailedCombining

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/bin/audiobook-dl", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.4.3', 'console_scripts', 'audiobook-dl')())
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 58, in run
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/exceptions.py", line 12, in print
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/logging.py", line 35, in print_error_file
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/logging.py", line 24, in read_asset_file
File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/zipfile.py", line 2362, in read_text
with self.open('r', *args, **kwargs) as strm:
File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/zipfile.py", line 2342, in open
raise FileNotFoundError(self)
FileNotFoundError: /opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/assets/errors/failed_combining.txt

error when combining mp3s: folder name replication not seen by script

Hi - has been working really well, but now I'm getting the following error. It seems that the directory folder name is being duplicated (but it's not finding it because the extra folder name doesn't exist when the files are saved). mp3s are being saved fine, but not being converted. Actual folder name is BOOK NAME/BOOK NAME - Part 1.mp3:

Downloading 26 files - BOOK NAME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
Converting files
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/mutagen-1.46.0-py3.10.egg/mutagen/_util.py", line 250, in _openfile
fileobj = open(filename, "rb+" if writable else "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'BOOK NAME/BOOK NAME/BOOK NAME - Part 1.mp3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/bin/audiobook-dl", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.4.3', 'console_scripts', 'audiobook-dl')())
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 56, in run
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/main.py", line 77, in run_on_url
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 50, in download
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/download.py", line 173, in add_metadata_to_dir
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/init.py", line 7, in add_metadata
File "/opt/homebrew/lib/python3.10/site-packages/audiobook_dl-0.4.3-py3.10.egg/audiobookdl/output/metadata/id3.py", line 34, in add_id3_metadata
File "/opt/homebrew/lib/python3.10/site-packages/mutagen-1.46.0-py3.10.egg/mutagen/_file.py", line 47, in init
self.load(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/mutagen-1.46.0-py3.10.egg/mutagen/_util.py", line 153, in wrapper
with _openfile(self, filething, filename, fileobj,
File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/opt/homebrew/lib/python3.10/site-packages/mutagen-1.46.0-py3.10.egg/mutagen/_util.py", line 271, in _openfile
raise MutagenError(e)
mutagen.MutagenError: [Errno 2] No such file or directory: 'BOOK NAME/BOOK NAME/BOOK NAME - Part 1.mp3'

getting error

PS C:\Users\Hp\Downloads\Compressed\audiobook-dl-master_6\audiobook-dl-master> audiobook-dl -c C:\cookies.txt https://www.scribd.com/listen/482526241
Finding compatible source
Traceback (most recent call last):
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\Scripts\audiobook-dl-script.py", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.1.0', 'console_scripts', 'audiobook-dl')())
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl_main_.py", line 51, in run
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl\download.py", line 15, in download
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl\sources\scribd.py", line 71, in before
TypeError: 'NoneType' object is not subscriptable
PS C:\Users\Hp\Downloads\Compressed\audiobook-dl-master_6\audiobook-dl-master>

ID3NoHeaderError

Hello, sorry again, another strange error (strange for me😅)...I don't know what to do. The mp3 is ok, mp3 works but has no cover.
Screenshot_20231002_153833_Termux

Thanks again for your help

Failed to combine audio files

I tried downloading audiobooks from Scribd. It's getting downloaded without any issues. But when I try to combine them, I get the following error.

ERROR: Failed to combine audio files

I'm in the latest version (v0.4.3). I have also installed the latest version of ffmpeg. I use a cookie file to download the audiobook. I have attached the screenshot for reference.

image

audiobooks.com: list index out of range

On Manjaro Linux 21.2.1

$ audiobook-dl -c ../cookies-audiobooks-com.txt https://www.audiobooks.com/book/stream/492141
Finding compatible source
Downloading metadata
Downloading 0 files - Bíblia Sagrada King James Atualizada - Antig… …
Traceback (most recent call last):
File "/usr/bin/audiobook-dl", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')())
File "/usr/lib/python3.10/site-packages/audiobook_dl-0.3.0-py3.10.egg/audiobookdl/main.py", line 52, in run
File "/usr/lib/python3.10/site-packages/audiobook_dl-0.3.0-py3.10.egg/audiobookdl/download.py", line 31, in download
IndexError: list index out of range

Saxo: Nonseries book

Installation method:
Github repo

Version:
Python version 3.10.10 and audiobook-dl version latest

Describe the bug
Når man downloader en non-series book kaster den en fejl.
Har lavet en midlertidig løsning lokalt ved at ud kommenterer result.series = metadata["seriesName"]

Command output
python -m audiobookdl --username username --password password --combine https://www.saxo.com/dk/good-omens_lydbog-download_9780061967078

Traceback (most recent call last):
File "/nix/store/0n4y44dnaxafqs7cg625aldrb152x7bx-python3-3.10.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/nix/store/0n4y44dnaxafqs7cg625aldrb152x7bx-python3-3.10.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/ugilt3/audiobook-dl/audiobookdl/main.py", line 102, in
run()
File "/home/ugilt3/audiobook-dl/audiobookdl/main.py", line 61, in run
run_on_url(options, url)
File "/home/ugilt3/audiobook-dl/audiobookdl/main.py", line 83, in run_on_url
download(s, options)
File "/home/ugilt3/audiobook-dl/audiobookdl/output/download.py", line 22, in download
audiobook = create_audiobook(source)
File "/home/ugilt3/audiobook-dl/audiobookdl/output/download.py", line 41, in create_audiobook
metadata = source.get_metadata(),
File "/home/ugilt3/audiobook-dl/audiobookdl/sources/saxo.py", line 95, in get_metadata
result.series = metadata["seriesName"]
KeyError: 'seriesName'

overdrive download suddenly fails

I'm not sure what changed. The last couple books worked fine, but suddenly I'm getting an error from overdrive.

$audiobook-dl --debug "https://ofs-fde98bc6ceb0236ee92aa55127e4df00.listen.overdrive.com/?d=eyJvdXRsZXQiOiJsaXN0ZW4iLCJ0b2tlbiI6Im1vbnRnb21lcnljby0xNjcxNDAxIiwiYWNjZXNzIjoiZiIsImV4cGlyZXMiOjE2Nzk0MjI3MjYsInRoZW1lIjoiZGVmYXVsdCIsInN5bmMiOjEsInBwYXJhbSI6Ikd6bDRHNVJyX09RckRQRmV5X0xnRWciLCJ0ZGF0YSI6eyJDUklEIjoiMjFiOWJhZDQtYTlhNi00NDcyLWE2YjMtODVhZDMyNjcxOGY0IiwiZm9ybWF0IjoiNjI1In0sInZlcnNpb24iOm51bGwsInRpbWUiOjE2NzgxNDMwMjYsImJ1aWQiOiJmZGU5OGJjNmNlYjAyMzZlZTkyYWE1NTEyN2U0ZGYwMCIsIl9jIjoiMTY3ODE0OTAyNDE5MCJ9--c2a1fa59ea9b8a1ff66ef13f73fe2ed855825960&p=Gzl4G5Rr_OQrDPFey_LgEg"
DEBUG Searching for missing dependencies
Finding compatible source
Downloading metadata
DEBUG Failed to download data from:
https://ofs-fde98bc6ceb0236ee92aa55127e4df00.listen.overdrive.com/?d=eyJvdXRsZXQiOiJsaXN0ZW4iLCJ0b2tlbiI6Im1vbnRnb21lcnlj
by0xNjcxNDAxIiwiYWNjZXNzIjoiZiIsImV4cGlyZXMiOjE2Nzk0MjI3MjYsInRoZW1lIjoiZGVmYXVsdCIsInN5bmMiOjEsInBwYXJhbSI6Ikd6bDRHNVJyX
09RckRQRmV5X0xnRWciLCJ0ZGF0YSI6eyJDUklEIjoiMjFiOWJhZDQtYTlhNi00NDcyLWE2YjMtODVhZDMyNjcxOGY0IiwiZm9ybWF0IjoiNjI1In0sInZlcn
Npb24iOm51bGwsInRpbWUiOjE2NzgxNDMwMjYsImJ1aWQiOiJmZGU5OGJjNmNlYjAyMzZlZTkyYWE1NTEyN2U0ZGYwMCIsIl9jIjoiMTY3ODE0OTAyNDE5MCJ
9--c2a1fa59ea9b8a1ff66ef13f73fe2ed855825960&p=Gzl4G5Rr_OQrDPFey_LgEg
Response:
b'{"book":"fde98bc6ceb0236ee92aa55127e4df00","code":"D001","path":"/","p":"Gzl4G5Rr_OQrDPFey_LgEg"}'
ERROR: Error while making request to server

I noticed that my previous cookie-grabbing chrome extension was only getting 2 of the site cookies, so I opted to use the firefox extension cookies.txt, instead. It correctly grabbed all of them.

audiobook-dl was pip3 installed (anaconda - Python 3.9.13) on OSX.

AttributeError: module 'functools' has no attribute 'cache'

When I run:
audiobook-dl --username <username> --password <password> <url of storytel audiobook>

I get:

Traceback (most recent call last):
  File "/usr/local/bin/audiobook-dl", line 5, in <module>
    from audiobookdl.__main__ import run
  File "/usr/local/lib/python3.8/dist-packages/audiobookdl/__init__.py", line 1, in <module>
    from .utils.audiobook import AudiobookFile, Chapter
  File "/usr/local/lib/python3.8/dist-packages/audiobookdl/utils/__init__.py", line 4, in <module>
    @functools.cache
AttributeError: module 'functools' has no attribute 'cache'

What am I doing wrong?

BookBeat chapter

Installation method:
Github repo or pip/pypi
pip

Version:
Python version and audiobook-dl version
newest Version

Describe the bug
i Tried Bookbeats , it download it perfect, but it not make any chapters and it´s mp4 in the end

Command output
DEBUG audiobook-dl 0.6.2
DEBUG python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)]
Finding compatible source
Authenticating with bookbeat
DEBUG Logging in

Downloading xxxxxxxxxxxxxxxxxx… from bookbeat
DEBUG Starting downloading file:
https://prod-bb-download.akamaized.net/api/download/mp4/xxxxxxxxxxxxxxxxx token=xxxxxxxxxxxxxxxxxxx
Downloading Die Mutter – Mommy liebt dich über alles … ---------------------------------------- 100%
Adding chapters
DEBUG Could not add chapters
Adding metadata
Embedding cover

any solution or did i make something wrong ?

KeyError: 'iisbn'

Installation method:
PIP

Version:
Python 3.9.2
audiobook-dl 0.6.2

Describe the bug
Crash

Command output
audiobook-dl --username MASKED* --password MASKED* MASKED* -d

DEBUG audiobook-dl 0.6.2
DEBUG python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110]
Finding compatible source
Authenticating with storytel
DEBUG Logging in
Traceback (most recent call last):
File "/usr/local/bin/audiobook-dl", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/audiobookdl/main.py", line 32, in main
process_url(url, options, config)
File "/usr/local/lib/python3.9/dist-packages/audiobookdl/main.py", line 53, in process_url
result = source.download(url)
File "/usr/local/lib/python3.9/dist-packages/audiobookdl/sources/storytel.py", line 67, in download
cover = self.download_cover(book_info),
File "/usr/local/lib/python3.9/dist-packages/audiobookdl/sources/storytel.py", line 168, in download_cover
isbn = book_info["abook"]["iisbn"]
KeyError: 'iisbn'

Running on a Raspberry PI4B w. Raspbian bullseye

getting error in new version

i uninstalled old audiobook dl version and download your new project then i installed again audiobook dl but i am getting this error evan i have installed successfully this Crypto file

PS C:\Users\Hp\Downloads\Compressed\audiobook-dl-master_7\audiobook-dl-master> audiobook-dl -c C:\cookies.txt https://www.scribd.com/listen/377204561
Traceback (most recent call last):
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\Scripts\audiobook-dl-script.py", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.1.0', 'console_scripts', 'audiobook-dl')())
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\Scripts\audiobook-dl-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\importlib\metadata_init_.py", line 162, in load
module = import_module(match.group('module'))
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl_main
.py", line 2, in
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl\sources_init
.py", line 1, in
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl\sources\sources.py", line 1, in
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl\sources\scribd.py", line 1, in
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl\utils\source.py", line 3, in
File "C:\Users\Hp\AppData\Local\Programs\Python\Python310\lib\site-packages\audiobook_dl-0.1.0-py3.10.egg\audiobookdl\utils\downloadthread.py", line 3, in
ModuleNotFoundError: No module named 'Crypto'
PS C:\Users\Hp\Downloads\Compressed\audiobook-dl-master_7\audiobook-dl-master>

Mp4 chapters

Add support for adding chapters to mp4 files.

It looks like mutagen currently doesn't support writing mp4 chapters.

Please help, Filenotfounderror

Hello to All, sorry, could anyone kindly help me to run this program, please? I am a new user stuck here and I am not a programmer, don't know what to do now

raise FileNotFoundError(self)
FileNotFoundError: /data/data/com.termux/files/usr/lib/python3.11/site-packages/audiobook_dl-0.6.2-py3.11.egg/audiobookdl/assets/simple_help.txt

Thank you very much for your time and help.

getting user not authorized over all accounts

Hi again - I'm not sure if this is a bug or something being throttled on my accounts, but I've tried over three accounts (checked the cookies file for each) and tried multiple audiobooks, and am getting the same error each time. Are you able to replicate this? If not, please feel to trash this and I'll see what's happening on my accounts. Latest release installed.

DEBUG audiobook-dl 0.4.4
DEBUG python 3.10.9 (main, Dec 15 2022, 10:44:50) [Clang 14.0.0
(clang-1400.0.29.202)]
DEBUG Searching for missing dependencies
Finding compatible source
DEBUG Could not find match from https://www.scribd.com/listen/xxxxxxxxxxx with
(?<=(external_id":"))(scribd_)?\d+
ERROR: User not authorized

Make sure you have given the correct cookies with the --cookie
argument or with --username and --password, and
have all the right permissions to access the book you are trying to download.
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/sources/scribd.py", line 88, in prepare
book_id = self.find_in_page(
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/sources/source/init.py", line 138, in find_in_page
raise DataNotPresent
audiobookdl.exceptions.DataNotPresent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/main.py", line 61, in run
run_on_url(options, url)
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/main.py", line 83, in run_on_url
download(s, options)
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/download.py", line 22, in download
audiobook = create_audiobook(source)
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/output/download.py", line 35, in create_audiobook
source.prepare()
File "/opt/homebrew/lib/python3.10/site-packages/audiobookdl/sources/scribd.py", line 93, in prepare
raise UserNotAuthorized
audiobookdl.exceptions.UserNotAuthorized

Make types compatible with python 3.8.0

Installation method:
Same issue with pip and using setup.py from repo

Version:
Python: Python 3.8.10
audiobook-dl: 0.5.0

Describe the bug
Receive the following error any time I try to run audiobook-dl, regardless of parameters (or with no parameters at all)

Command output
» audiobook-dl
Traceback (most recent call last):
File "/usr/local/bin/audiobook-dl", line 5, in
from audiobookdl.main import run
File "/usr/local/lib/python3.8/dist-packages/audiobookdl/init.py", line 1, in
from .utils.audiobook import AudiobookFile, Chapter, AudiobookMetadata, Cover, Audiobook
File "/usr/local/lib/python3.8/dist-packages/audiobookdl/utils/init.py", line 21, in
def nearest_string(input: str, list: list[str]) -> str:
TypeError: 'type' object is not subscriptable

add cloudlibrary support

It is similar to overdrive, audiobook on cloudlibrary is streaming on the website and no DRM.

TypeError: unsupported operand type(s) for |: 'type' and 'ABCMeta'

I get an error when I run the package on Linux.
This is a fresh install on Debian.

hcbille@penguin:~/Audiobook-WebGUI$ audiobook-dl
Traceback (most recent call last):
File "/home/hcbille/.local/bin/audiobook-dl", line 5, in
from audiobookdl.main import run
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/init.py", line 2, in
from .sources.source import Source
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/sources/init.py", line 1, in
from .source import Source
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/sources/source/init.py", line 2, in
from . import networking
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/sources/source/networking.py", line 1, in
from audiobookdl import AudiobookFile, exceptions, logging
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/exceptions.py", line 2, in
from .logging import print_error_file, error
File "/home/hcbille/.local/lib/python3.9/site-packages/audiobookdl/logging.py", line 48, in
def progress(progress_format: list[str | ProgressColumn]) -> Progress:
TypeError: unsupported operand type(s) for |: 'type' and 'ABCMeta'

OSError: [Errno 22] Invalid argument

Trying to download this book from nextory: https://www.nextory.se/bok/allt-vi-inte-ser-s%C3%A5-p%C3%A5verkas-du-av-det-osynliga-arbetet-hemma-och-p%C3%A5-jobbet-11866672/

audiobook-dl --username XXXXX --password YYYYY https://www.nextory.se/bok/allt-vi-inte-ser-s%C3%A5-p%C3%A5verkas-du-av-det-osynliga-arbetet-hemma-och-p%C3%A5-jobbet-11866672/ -o /audiobook/{title}

I'm guessing it's -o /audiobook/{title} that break everything due to the ":" in the book-title.

I have a few more examples of booktitles that fail the same way, most likely due to the "illegal" characters:

exit status 1

Finding compatible source
Downloading metadata
Traceback (most recent call last):
  File "/usr/local/bin/audiobook-dl", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.10/site-packages/audiobookdl/__main__.py", line 44, in run
    run_on_url(options, url)
  File "/usr/local/lib/python3.10/site-packages/audiobookdl/__main__.py", line 65, in run_on_url
    download(s, options)
  File "/usr/local/lib/python3.10/site-packages/audiobookdl/output/download.py", line 32, in download
    filenames = download_files_output(source, files, output_dir)
  File "/usr/local/lib/python3.10/site-packages/audiobookdl/output/download.py", line 66, in download_files_output
    setup_download_dir(output_dir)
  File "/usr/local/lib/python3.10/site-packages/audiobookdl/output/download.py", line 58, in setup_download_dir
    os.makedirs(path)
  File "/usr/lib64/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [Errno 22] Invalid argument: '/audiobook/Allt vi inte ser : så påverkas du av det osynliga arbetet - hemma och på jobbet'

Missing dependency appdirs

Installation method:
Github repo or pip/pypi
pip

Version:
Python version and audiobook-dl version
0.6.2

Describe the bug
A clear and concise description of what the bug is.
when appdirs is not installed, it will fail at:
➜ ~ audiobook-dl --help
Traceback (most recent call last):
File "/usr/local/bin/audiobook-dl", line 5, in
from audiobookdl.main import main
File "/usr/local/lib/python3.9/site-packages/audiobookdl/main.py", line 6, in
from .config import load_config, Config
File "/usr/local/lib/python3.9/site-packages/audiobookdl/config.py", line 7, in
import appdirs
ModuleNotFoundError: No module named 'appdirs'

This should be fixed by including the necessary module while installing.

Command output
Command and output with --debug flag

Blinkist metadata

Installation method:
Github repo

Version:
latest version pulled from github to get blinkist.com support

Describe the bug
The metadata does not correctly add the author.
image
This is after downloading my books.

Metadata for a file:

kMDItemAlternateNames                  = (
    "12 Rules For Life - Part 0.m4a"
)
kMDItemAudioBitRate                    = 128155
kMDItemAudioChannelCount               = 1
kMDItemAudioSampleRate                 = 44100
kMDItemAuthors                         = (
    n
)
kMDItemContentCreationDate             = 2023-08-07 15:23:30 +0000
kMDItemContentCreationDate_Ranking     = 2023-08-07 00:00:00 +0000
kMDItemContentModificationDate         = 2023-08-07 15:28:08 +0000
kMDItemContentModificationDate_Ranking = 2023-08-07 00:00:00 +0000
kMDItemContentType                     = "com.apple.m4a-audio"
kMDItemContentTypeTree                 = (
    "com.apple.m4a-audio",
    "public.mpeg-4-audio",
    "public.audio",
    "public.audiovisual-content",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded                       = 2023-08-07 15:23:30 +0000
kMDItemDateAdded_Ranking               = 2023-08-07 00:00:00 +0000
kMDItemDisplayName                     = "12 Rules For Life"
kMDItemDocumentIdentifier              = 0
kMDItemDurationSeconds                 = 73.02428571428571
kMDItemFSContentChangeDate             = 2023-08-07 15:28:08 +0000
kMDItemFSCreationDate                  = 2023-08-07 15:23:30 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "12 Rules For Life - Part 0.m4a"
kMDItemFSNodeCount                     = (null)
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 1189243
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2023-08-07 00:00:00 +0000
kMDItemKind                            = "Apple MPEG-4 audio"
kMDItemLogicalSize                     = 1189243
kMDItemMediaTypes                      = (
    Sound
)
kMDItemPhysicalSize                    = 2236416
kMDItemTitle                           = "12 Rules For Life"
kMDItemTotalBitRate                    = 128155

Error while trying to download from storytel

Installation method:
pip

Version:
The latest version of Python and audiobook-dl

Describe the bug
While trying to log in to download audiobook via Storytel, i get the following error

self.single_signon_token = user_data["singleSignToken"]
KeyError: 'singleSignToken'

Command output
Command and output with --debug flag

nextory ERROR: Missing data from source

Installation method:
pip install audiobook-dl

Version:
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux

Describe the bug
Downloading from nextory fails with "missing data from source"

In android app book is in "my library" showing in "recent" and under "mylist" in Downloaded. Account only has one profile where the book is. Based on https://github.com/jo1gi/audiobook-dl/blob/master/supported_sites.md I believe this is how it should be. Book URL is acquired via web browser and format looks similar to for what support was added here 50ce349 except country of course

Book url in format https://nextory.com/fi/book/boo-ok-99999

Command output
audiobook-dl -d --username user --password pass https://nextory.com/fi/book/boo-ok-99999

DEBUG audiobook-dl 0.6.2
DEBUG python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Finding compatible source
Authenticating with nextory
DEBUG Logging in
ERROR: Missing data from source

audiobook-dl is missing data from source. This can happen when you try to
download audiobooks you don't have access too (not logged in or your profile
doesn't have the right permissions), the site has been updated and audiobook-dl
hasn't implemented the new version, or it could be a bug in audiobook-dl.

If you think it is a problem with audiobook-dl please create an issue at
https://github.com/jo1gi/audiobook-dl/issues
Traceback (most recent call last):
  File "/home/x/.local/lib/python3.10/site-packages/audiobookdl/__main__.py", line 32, in main
    process_url(url, options, config)
  File "/home/x/.local/lib/python3.10/site-packages/audiobookdl/__main__.py", line 53, in process_url
    result = source.download(url)
  File "/home/x/.local/lib/python3.10/site-packages/audiobookdl/sources/nextory.py", line 40, in download
    book_info = self.find_book_info(book_id)
  File "/home/x/.local/lib/python3.10/site-packages/audiobookdl/sources/nextory.py", line 59, in find_book_info
    raise DataNotPresent
audiobookdl.exceptions.DataNotPresent

Any idea if I'm doing something wrong or if the app is not compatible with the current version of nextory?

Unable to download Scribd Originals

Installation method:
pip

Version:
Python version: 3.10.0 and audiobook-dl version: 0.6.2

Describe the bug
I get "ERROR: Missing data from source" while downloading certain audiobooks from scribd. Example link. The audiobook can be played via the web browser without any issues.

Command output
*Command: audiobook-dl https://www.scribd.com/audiobook/629017918/Burn-for-the-Dragon --debug
Output:
DEBUG audiobook-dl 0.6.2
DEBUG python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
INFO Finding compatible source
INFO Authenticating with scribd
DEBUG Loading cookies from './cookies.txt'
DEBUG Could not find match from https://www.scribd.com/listen/629017918 with (?<=("jwt_token":"))[^"]+
ERROR: Missing data from source *

CTOC with over 256 child_element_ids causes crash

I'm getting a crash when trying to download audiobooks with more than 256 chapters.

ValueError: bytes must be in range(0, 256)

It seems CTOC can't take more than 256 child_element_ids. If I limit the range to 255 it works fine:

child_element_ids=[u"chp"+str(i+1) for i in range(len(chapters))],

I also noticed that even if some chapters aren't in child_element_ids they still work fine in mpv and show up in ffprobe. They even work without CTOC. Should we split the chapters up in multiple CTOCs? Do we need the CTOC at all?

A book with more than 256 chapters:
https://www.storytel.com/no/books/1984-1109466

fetching metadata

Will the audio from scribd containing metadata(author,narrator),if it does, what is the error that I can't get it?
File "C:\Program Files\Python39\Scripts\audiobook-dl-script.py", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.1.0', 'console_scripts', 'audiobook-dl')())
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl_main_.py", line 42, in run
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl\utils\service.py", line 138, in download
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl\utils\metadata.py", line 30, in add_metadata
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.1.0-py3.9.egg\audiobookdl\utils\metadata.py", line 20, in add_id3_metadata
AttributeError: 'NoneType' object has no attribute 'items'

`--output-format=mkv` does transcode instead of transmux

Installation method:
pip

Version:
audiobook-dl 0.5.0
(have also ffmpeg installed)

Describe the bug
The Converting files step takes a very long time, which is an indication it's doing an expensive transcode.

mp4 -> mkv should be a transmux, i.e. ffmpeg just changes the containers instead of doing expensive process of decode -> encode with possibly different codec.

The options given to ffmpeg should probably be -vcodec copy and -acodec copy ask ffmpeg to do a transmux instead of a transcode: https://blog.programster.org/ffmpeg-losslessly-convert-mp4-to-mkv

Quick glance at source code looks like it's only giving input and output filenames to ffmpeg, maybe ffmpeg by default is then doing a transcode:

["ffmpeg", "-i", old_path, new_path],

Python throws an error

This isn't exactly a bug, as the files downloaded as far as I can tell, but here is the output of the command which seems to show an error. I am not sure what it is, and I don't have time to debug too much at the moment, but I thought I would let you know in case it is helpful for you.

I downloaded a book from Chirp, if that helps.

Converting files
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/audiobook-dl", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/__main__.py", line 56, in run
    run_on_url(options, url)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/__main__.py", line 77, in run_on_url
    download(s, options)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/download.py", line 50, in download
    add_metadata_to_dir(source, filenames, output_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/download.py", line 173, in add_metadata_to_dir
    metadata.add_metadata(filename, source.metadata())
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/metadata/__init__.py", line 9, in add_metadata
    id3.add_id3_metadata(filepath, metadata)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/audiobookdl/output/metadata/id3.py", line 34, in add_id3_metadata
    audio = MP3(filepath, ID3=EasyID3)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_file.py", line 47, in __init__
    self.load(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_util.py", line 155, in wrapper
    return func(self, h, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/id3/_file.py", line 420, in load
    self.info = self._Info(fileobj, offset)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/_util.py", line 184, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mutagen/mp3/__init__.py", line 401, in __init__
    raise HeaderNotFoundError("can't sync to MPEG frame")
mutagen.mp3.HeaderNotFoundError: can't sync to MPEG frame

scribd did not work for me

scribd did not work for me

inding compatible source
Traceback (most recent call last):
File "C:\Users\AppData\Local\Programs\Python\Python36\Scripts\audiobook-dl-script.py", line 11, in
load_entry_point('audiobook-dl==0.1.0', 'console_scripts', 'audiobook-dl')()
File "C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\audiobook_dl-0.1.0-py3.6.egg\audiobookdl_main_.py", line 54, in run
File "C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\audiobook_dl-0.1.0-py3.6.egg\audiobookdl\download.py", line 15, in download
File "C:\Users\AppData\Local\Programs\Python\Python36\lib\site-packages\audiobook_dl-0.1.0-py3.6.egg\audiobookdl\sources\scribd.py", line 71, in before
TypeError: 'NoneType' object is not subscriptable

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.