ping / odmpy

A simple command line manager for OverDrive/Libby loans. Download your library loans from the command line.
GNU General Public License v3.0
288 stars 19 forks source link

audio books not downloading #70

Open jahlborn opened 5 months ago

jahlborn commented 5 months ago

Describe the problem i reset my libby config as noted elsewhere, but it seems like there are more issues (maybe some changes in the result data structures). got this error:

An unexpected error has occurred
Traceback (most recent call last):
  File "/home/james/.local/lib/python3.8/site-packages/odmpy/odm.py", line 950, in run
    openbook, toc = libby_client.process_audiobook(
  File "/home/james/.local/lib/python3.8/site-packages/odmpy/libby.py", line 837, in process_audiobook
    openbook = self.make_request(meta["urls"]["openbook"])
KeyError: 'openbook'

To Reproduce attempt to download an audiobook.

Version/Environment odmpy 0.8.1 [Python 3.8.10-linux]

stenou commented 5 months ago

You can't use --direct anymore

stenou commented 5 months ago

It looks like this library no longer works as of today. They have changed their auth scheme.

mitrian7 commented 5 months ago

Looks like they're systematically engineering all these download tools out of existence. First the Chrome extension (Libby Audiobook Exporter), then the Firefox extension (Libby Download), now odmpy. Only thing that still works (that I can find) is inspecting pages in developer mode.

jahlborn commented 5 months ago

Looks like they're systematically engineering all these download tools out of existence. First the Chrome extension (Libby Audiobook Exporter), then the Firefox extension (Libby Download), now odmpy. Only thing that still works (that I can find) is inspecting pages in developer mode.

apparently you can still use overdrive https://www.reddit.com/r/audiobooks/comments/13gt1fb/download_and_transfer_libby_audiobooks_through/

wtanksleyjr commented 5 months ago

Recommend we continue writing this up on the earlier bug report, and close this one.

thejoester commented 5 months ago
Opening audiobook "Fairy Tale"...
Downloaded odm to "c:\Users\joe\Downloads\Libby\fairy-tale-8740733.odm"
An unexpected error has occurred
Traceback (most recent call last):
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\odmpy\odm.py", line 1210, in run
    process_odm(
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\odmpy\processing\odm.py", line 135, in process_odm
    raise ValueError("Unable to find Metadata in ODM")
ValueError: Unable to find Metadata in ODM
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts\odmpy.exe\__main__.py", line 7, in <module>
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\odmpy\__main__.py", line 27, in main
    run()
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\odmpy\odm.py", line 1210, in run
    process_odm(
  File "C:\Users\joe\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\odmpy\processing\odm.py", line 135, in process_odm
    raise ValueError("Unable to find Metadata in ODM")
ValueError: Unable to find Metadata in ODM
thejoester commented 5 months ago

Additionally when I look at the .odm file...

<!DOCTYPE html>
<html>
<head>
<title>Access Error</title>
<style>pre { font: 12px/18px monospace; }</style>
</head>
<body>
<pre>
{
  &quot;result&quot;: &quot;missing_chip&quot;,
  &quot;policies&quot;: {
    &quot;privacy&quot;: &quot;https://company.cdn.overdrive.com/policies/privacy-policy&quot;,
    &quot;terms&quot;: &quot;https://company.cdn.overdrive.com/policies/terms-and-conditions.htm&quot;,
    &quot;jobs&quot;: &quot;https://company.overdrive.com/careers&quot;
  }
}
</pre>
</body>
<script type="text/javascript" src="/scripts/bridge.js"></script>
<script type="text/javascript">setTimeout(function(){BRIDGE.transmit({name:'sentry:access:error',dest:'client',error:{origin:'Sentry'}});},500);</script>
</html>
wtanksleyjr commented 5 months ago

Highly recommend we close this, there are useful instructions for limited workarounds in #69 . For example, you can manually download an ODM file and then use odmpy to get the book.

Suburban-Vampire commented 5 months ago

just to chime in here with a brief summary of the status of things as of 4/25/2024: -OverDrive is the company behind both the older OverDrive app and the newer Libby app. -the OverDrive app itself has been sunsetted by the company in favor of Libby -ODM Download Links have been REMOVED from public library web interfaces. As best as I can tell there is currently NO easy or direct way to get ahold of an ODM file for a borrowed book, period. It's just not a thing anymore.

-In the last few days OverDrive has made changes to the Libby app & infrastructure that explicitly break ALL third party downloading. -At the same time, all major browser extensions related to Libby have been taken down.

thejoester commented 5 months ago

-ODM Download Links have been REMOVED from public library web interfaces. As best as I can tell there is currently NO easy or direct way to get ahold of an ODM file for a borrowed book, period. It's just not a thing anymore.

This is not fully accurate. The Overdrive web pages still exist and you can download the .odm directly as well as through the app itself which still operates but is no longer supported and the app download is not published publicly but there is links above to get the .msi installer file.

Suburban-Vampire commented 5 months ago

By jove, you're right! I actually did NOT know about the overdrive.com subdomain thing. Many thanks :)

For example, my main library interface (that they tell me to use) is wccls.bibliocommons.com. Unbeknownst to me, this means I can actually just go to wccls.overdrive.com to access a per-library interface where YES YOU CAN download ODM files, at least for now.

In my use case, I then fed the ODM to a Windows command line utility, Mbucari/OverdriveDownloader, which happily did get all the audio & metadata as expected.

It would seem the next big source of problems will be whenever Overdrive decides to shut that all down. Hopefully not soon!

nerdguy1338 commented 5 months ago

By jove, you're right! I actually did NOT know about the overdrive.com subdomain thing. Many thanks :)

For example, my main library interface (that they tell me to use) is wccls.bibliocommons.com. Unbeknownst to me, this means I can actually just go to wccls.overdrive.com to access a per-library interface where YES YOU CAN download ODM files, at least for now.

In my use case, I then fed the ODM to a Windows command line utility, Mbucari/OverdriveDownloader, which happily did get all the audio & metadata as expected.

It would seem the next big source of problems will be whenever Overdrive decides to shut that all down. Hopefully not soon!

The odm files you can download this way still work with odmpy DL file.odm

ziferius commented 5 months ago

The OverDrive ODM download being 'complicated' or Overdrive hiding the library pages is currently (04/27/2024) overblown. They aren't hiding anything. Go to https://www.overdrive.com, in the top right hand corner, there is 'Find Library'; then type in the zip. Then login with your library credentials.

I use Firefox...... and Linux. So I needed to add an extension 'User-agent switcher' so switch to Firefox to masquerade as Windows.

Then, on your Library's overdrive page, click on my account (top right), then go to loans. Under the big 'Listen now in browser' button, there is a link a few lines down for 'Have OverDrive for Mac/Windows?' Click on that; a download MP3 audiobook pops up. That is the link to the real/fullsize odm file.

nerdguy1338 commented 5 months ago

Overblown? Maybe a bit but this process is what we were doing before odmpy. It's just so darn convenient!

On Sat, Apr 27, 2024, 7:19 PM ziferius @.***> wrote:

The OverDrive ODM download being 'complicated' or Overdrive hiding the library pages is currently (04/27/2024) overblown. They aren't hiding anything. Go to https://www.overdrive.com, in the top right hand corner, there is 'Find Library'; then type in the zip. Then login with your library credentials.

I use Firefox...... and Linux. So I needed to add an extension 'User-agent switcher' so switch to Windows.

Then, on your Library's overdrive page, click on my account (top right), then go to loans. Under the big 'Listen now in browser' button, there is a link a few lines down for 'Have OverDrive for Mac/Windows?' Click on that; a download MP3 audiobook pops up. That is the link to the real/fullsize odm file.

— Reply to this email directly, view it on GitHub https://github.com/ping/odmpy/issues/70#issuecomment-2081232634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZOBBC6QLI4GQJCGKLJTMDY7QW7ZAVCNFSM6AAAAABGZAB26KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRGIZTENRTGQ . You are receiving this because you commented.Message ID: @.***>

Prajna-Karuna commented 5 months ago

there is a link a few lines down for 'Have OverDrive for Mac/Windows?'

That is what I was missing. Thank you.

wtanksleyjr commented 5 months ago

Have you run odmpy before? If you haven't you need to get it set up, so I'll assume you have.

Just run odmpy dl <odmfilename>. It'll create a folder with all of the audio files and so on. I also like to use the -k option, since otherwise audiobookshelf has problems with the thumbnail.

-Wm

On Fri, May 3, 2024 at 1:20 PM pozix604 @.***> wrote:

Sorry, I don't follow. With the ODM file downloaded from the overdrive.com site, how do I now use odmpy to download the audiobook?

— Reply to this email directly, view it on GitHub https://github.com/ping/odmpy/issues/70#issuecomment-2093708076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7H6PLKKEZEG5ERRMX5ALZAPWRVAVCNFSM6AAAAABGZAB26KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTG4YDQMBXGY . You are receiving this because you commented.Message ID: @.***>

stenou commented 5 months ago

I was able to download audiobooks using this PR

https://github.com/ping/odmpy/pull/71

Example Dockerfile to use the new branch

FROM debian

RUN apt update && apt install -y python3 python3-pip python3.11-venv git ffmpeg

RUN python3 -m venv /odmpy

ENV PATH="/odmpy/bin:$PATH"

RUN python3 -m pip install git+https://github.com/ahxxm/odmpy.git@fix-spine --upgrade --force-reinstall

RUN mkdir /books
WORKDIR /books
CMD ["/bin/bash"]
wtanksleyjr commented 5 months ago

Thank you, that's incredible, PLEASE post that to #69 which is supposed to contain the useful information for dealing with this. That's AWESOME.

ComputerWolf commented 5 months ago

I was able to download audiobooks using this PR

71

Example Dockerfile to use the new branch

FROM debian

RUN apt update && apt install -y python3 python3-pip python3.11-venv git ffmpeg

RUN python3 -m venv /odmpy

ENV PATH="/odmpy/bin:$PATH"

RUN python3 -m pip install git+https://github.com/ahxxm/odmpy.git@fix-spine --upgrade --force-reinstall

RUN mkdir /books
WORKDIR /books
CMD ["/bin/bash"]

This branch appears to have the same issue as the existing version. The odm files have an Access Error within them and won't work

ValueError: Unable to find Metadata in ODM

stenou commented 4 months ago

They changed something again and it now doesn't work

jayshomebrew commented 4 months ago

FYI, I've been using an older version without issues. Here's my process:

1. logon to overdrive.com download the .odm Screenshot_2024-05-12_06-35-09

2. pip3 install git+https://git@github.com/ping/odmpy.git@0.4.8 . . . Successfully built odmpy Installing collected packages: odmpy Successfully installed odmpy-0.4.8

3. python -m odmpy info *.odm

Screenshot_2024-05-12_06-45-48

4. python -m odmpy dl --chapters --merge --mergeformat mp3 --keepcover --keepmp3 *.odm

Screenshot_2024-05-12_06-49-19

all good.

wtanksleyjr commented 4 months ago

Any version of odmpy should work when you start with an ODM file, I'm using the most recent version. It's only the libby functionality that's dying.

factorymealy0m commented 4 months ago

Any updates on this ?