From d11269f967259a8565114d30bb4563d529aa3c96 Mon Sep 17 00:00:00 2001 From: N0Arxan Date: Mon, 3 Aug 2026 17:38:35 +0200 Subject: [PATCH] Preserve secret_password and support scribd.com subdomains in embed URL Password-protected/private Scribd links carry a secret_password query param and can use locale subdomains (e.g. es.scribd.com). The embed URL builder was dropping the password and only matching www.scribd.com, causing "No printable document pages were detected" for these links. --- scribd-downloader.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scribd-downloader.py b/scribd-downloader.py index 235400a..0d1bf9e 100644 --- a/scribd-downloader.py +++ b/scribd-downloader.py @@ -83,16 +83,26 @@ def convert_scribd_link(url): url: Standard Scribd URL such as https://www.scribd.com/document/123456789/Document-Title or https://www.scribd.com/doc/123456789/Document-Title + or https://es.scribd.com/document/123456789/Document-Title + optionally with a "?secret_password=..." query string for + privately shared documents. Returns: The embeddable content URL, or "Invalid Scribd URL" if no document id can be extracted. """ - match = re.search(r"https://www\.scribd\.com/(?:document|doc)/(\d+)/", url) + match = re.search(r"https://[\w.-]*scribd\.com/(?:document|doc)/(\d+)/", url) if not match: return "Invalid Scribd URL" - return f"https://www.scribd.com/embeds/{match.group(1)}/content" + embed_url = f"https://www.scribd.com/embeds/{match.group(1)}/content" + + query = urlparse(url).query + secret_password_match = re.search(r"secret_password=([^&]+)", query) + if secret_password_match: + embed_url += f"?secret_password={secret_password_match.group(1)}" + + return embed_url def get_filename_from_url(url):