question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

oreilly.com using library card

See original GitHub issue

Checklist

  • I’m reporting a new site support request
  • I’ve verified that I’m running youtube-dl version 2021.12.17
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that none of provided URLs violate any copyrights
  • I’ve searched the bugtracker for similar site support requests including closed ones

Example URLs

Description

You can access these resources if you have a https://www.hcpl.net/ library card.

After you have the library card , you can just go to https://www.hcpl.net/database/oreilly-public-libraries-formerly-safari-books-online and click “Go To Resource”

I am mainly interested to download the videos using cookie file. Please let me know how to send the cookie file.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dirkfcommented, Dec 21, 2021

With the top-level development directory (the one containing test) as current, python test/test_download.py TestDownload.test_YourExtractor tests the first (zeroth) test for YourExtractorIE, and add _n for the nth test. So:

python test/test_download.py TestDownload.test_Safari
python test/test_download.py TestDownload.test_Safari_1
...
python test/test_download.py TestDownload.test_SafariAPI
python test/test_download.py TestDownload.test_SafariAPI_1
...
python test/test_download.py TestDownload.test_SafariCourse
python test/test_download.py TestDownload.test_SafariCourse_1
...

To test your problem URLs, create entries in the TESTS list for the appropriate extractor classes, or just supply the options and url in:

python -m youtube_dl options url
1reaction
dirkfcommented, Dec 20, 2021

This patch should give access to the media in the pages with the quoted URLs (also back-port from yt-dlp):

--- old/youtube-dl/youtube_dl/extractor/safari.py
+++ new/youtube-dl/youtube_dl/extractor/safari.py
@@ -86,8 +86,11 @@
     IE_NAME = 'safari'
     IE_DESC = 'safaribooksonline.com online video'
     _VALID_URL = r'''(?x)
-                        https?://
-                            (?:www\.)?(?:safaribooksonline|(?:learning\.)?oreilly)\.com/
+                        https?://(?:www\.)?
+                            (?:
+                                (?:safaribooksonline|(?:learning\.)?oreilly)\.com|
+                                learning-oreilly-com\.hcpl\.idm\.oclc\.org
+                            )/
                             (?:
                                 library/view/[^/]+/(?P<course_id>[^/]+)/(?P<part>[^/?\#&]+)\.html|
                                 videos/[^/]+/[^/]+/(?P<reference_id>[^-]+-[^/?\#&]+)
@@ -193,17 +196,24 @@
         part = self._download_json(
             url, '%s/%s' % (mobj.group('course_id'), mobj.group('part')),
             'Downloading part JSON')
-        return self.url_result(part['web_url'], SafariIE.ie_key())
+        web_url = part['web_url']
+        if 'library/view' in web_url:
+            web_url = web_url.replace('library/view', 'videos')
+            natural_keys = part['natural_key']
+            web_url = '{0}/{1}-{2}'.format(web_url.rsplit("/", 1)[0], natural_keys[0], natural_keys[1][:-5])
+        return self.url_result(web_url, SafariIE.ie_key())
 
 
 class SafariCourseIE(SafariBaseIE):
     IE_NAME = 'safari:course'
     IE_DESC = 'safaribooksonline.com online courses'
-
     _VALID_URL = r'''(?x)
-                    https?://
+                    https?://(?:www\.)?
                         (?:
-                            (?:www\.)?(?:safaribooksonline|(?:learning\.)?oreilly)\.com/
+                            (?:
+                                (?:safaribooksonline|(?:learning\.)?oreilly)\.com|
+                                learning-oreilly-com\.hcpl\.idm\.oclc\.org
+                            )/
                             (?:
                                 library/view/[^/]+|
                                 api/v1/book|
Read more comments on GitHub >

github_iconTop Results From Across the Web

Library Access - O'Reilly
Get instant access through your library. Select your institution, Bern University of ... We will use your personal data in accordance with our...
Read more >
O'Reilly - How to use a Library Card to Access ... - YouTube
Here you'll find more than 35000 technology eBooks, interactive learning courses, 30000 hours of video and more ranging from basic computer ...
Read more >
O'Reilly Complete Public Library (formerly Safari Books Online)
About O'Reilly Complete Public Library · Sign in with your Library card from your internet-connected device and start reading now · Read technology...
Read more >
What is O'Reilly for Public Libraries? - SFPL - FAQ
O'Reilly for Public Libraries is an e-learning platform consisting of business ... Sign in with your 14-digit card number and PIN/password.
Read more >
O'Reilly for Public Libraries | Frequently Asked Questions
Cards & Accounts. Accounts & Item Renewals · Join! Free Library Card · Join! Instant Free eCard · Card Renewals · Address Changes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found