youtube-dl icon indicating copy to clipboard operation
youtube-dl copied to clipboard

[SBS] ERROR: Unsupported URL

Open DanielTheGreat opened this issue 3 years ago • 22 comments

youtube-dl is now failing to fetch videos from SBS On-Demand (Australia), well, this one at least (I haven't tried any others: ERROR: Unsupported URL: https://www.sbs.com.au/ondemand/movie/cyrano-my-love/1877284931942 I'd appreciate someone having a look to see if this can be corrected before that movie disappears from On-Demand (end of December 2021). Many thanks, Daniel (Australia)

DanielTheGreat avatar Dec 06 '21 12:12 DanielTheGreat

The problem URL doesn't correspond to any of the formats supported by the SBS extractor (ie, never supported).

However it's possible that this patch to the URL pattern would add support. In the UK it changes the error from "unsupported URL" to "content is not available in your location":

--- old/youtube-dl/youtube_dl/extractor/sbs.py
+++ new/youtube-dl/youtube_dl/extractor/sbs.py
@@ -10,7 +10,7 @@
 
 class SBSIE(InfoExtractor):
     IE_DESC = 'sbs.com.au'
-    _VALID_URL = r'https?://(?:www\.)?sbs\.com\.au/(?:ondemand(?:/video/(?:single/)?|.*?\bplay=|/watch/)|news/(?:embeds/)?video/)(?P<id>[0-9]+)'
+    _VALID_URL = r'https?://(?:www\.)?sbs\.com\.au/(?:ondemand(?:/video/(?:single/)?|/movie/(?:[\w-]+/)?|.*?\bplay=| /watch/)|news/(?:embeds/)?video/)(?P<id>[0-9]+)'
 
     _TESTS = [{
         # Original URL is handled by the generic IE which finds the iframe:

dirkf avatar Dec 06 '21 13:12 dirkf

I don't know what makes you think I'm outside of Australia!

Regards, Daniel

Daniel Ford (Gerroa, Australia) "Kindness is the language which the deaf can hear and the blind can see." - Mark Twain


From: Name @.*** Sent: 7 December 2021 12:33 AM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

region restricted:

You appear to be outside Australia. Due to publishing rights most of our videos are only available in Australia.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-986779958 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M5FH7AOVHIVEI7BXULUPS3QXANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4MZXUF4QHW3I3LSC52TUPS3QXA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLIRCNQ.gif

DanielTheGreat avatar Dec 07 '21 00:12 DanielTheGreat

Dirkf,

Thanks for your suggestion, but I don't understand what you're suggesting I do.

I'm a simple Windows user who just runs youtube-dl from the command line followed by a URL. I don't know how to do anything more than that.

If you could break down your suggestion into a series of simple one-line DOS/Powershell commands, I could maybe manage that.

I should mention that youtube-dl has worked in the past for downloading SBS videos, but they might (probably) have changed the streaming format to foil downloaders.

Regards, Daniel

Daniel Ford (Gerroa, Australia) "Kindness is the language which the deaf can hear and the blind can see." - Mark Twain


From: dirkf @.*** Sent: 7 December 2021 12:48 AM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

The problem URL doesn't correspond to any of the formats supported by the SBS extractor (ie, never supported).

However it's possible that this patch to the URL pattern would add support. In the UK it changes the error from "unsupported URL" to "content is not available in your location":

--- old/youtube-dl/youtube_dl/extractor/sbs.py +++ new/youtube-dl/youtube_dl/extractor/sbs.py @@ -10,7 +10,7 @@

class SBSIE(InfoExtractor): IE_DESC = 'sbs.com.au'

  • _VALID_URL = r'https?://(?:www.)?sbs.com.au/(?:ondemand(?:/video/(?:single/)?|.*?\bplay=|/watch/)|news/(?:embeds/)?video/)(?P[0-9]+)'
  • _VALID_URL = r'https?://(?:www.)?sbs.com.au/(?:ondemand(?:/video/(?:single/)?|/movie/(?:[\w-]+/)?|.*?\bplay=| /watch/)|news/(?:embeds/)?video/)(?P[0-9]+)'

    _TESTS = [{ # Original URL is handled by the generic IE which finds the iframe:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-986792522 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M5KCCQHKR4XLK3M2F3UPS5ILANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4M2TYGW3VWFEN4MT7KDUPS5ILA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLIUESQ.gif

DanielTheGreat avatar Dec 07 '21 00:12 DanielTheGreat

Sorry, my misunderstanding.

Regards, Daniel

Daniel Ford (Gerroa, Australia) "Kindness is the language which the deaf can hear and the blind can see." - Mark Twain


From: Name @.*** Sent: 7 December 2021 11:36 AM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

I don't know what makes you think I'm outside of Australia!

I was not commenting on your location. I was commenting on the video restriction, for anyone who might be interested in helping.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987431016 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4MZDA2KDBJECBMEJDQDUPVJGHANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4M5MBY7W6QLD7C7LSATUPVJGHA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLNQA2A.gif

DanielTheGreat avatar Dec 07 '21 00:12 DanielTheGreat

When the extractor may have worked in the past, it would have been with URLs like .../video/..., but the problem URL has .../movie/stuff/...

To support the movie URL, the line of code prefixed by - has to be changed to the one prefixed with +. A command-line program called patch is generally used to do this, but as it's only a small change this isn't necessary. This is good because that program will only be found in Windows if some Unix-y development tools have been installed.

As a Windows user, you probably have the single executable file version, youtube-dl.exe ~1.8MB, though other installation types are possible.

Currently the maintainers are not making new releases so patching or rebuilding are the only ways to change the code.

Fortunately it should be possible to use a Windows archive utility to patch the code. The idea is that you find youtube-dl.exe, then, similar to the instructions here and guidance in the surrounding discussion:

  • rename it to youtube-dl.zip
  • open the renamed self-extracting archive in the archive tool
  • edit the relevant file (in this case youtube_dl/extractor/sbs.py) in the archive
  • as you can see, the text in the URL pattern ...(?:single/)?|.*?\bplay=... has to be changed to ...(?:single/)?|/movie/(?:[\w-]+/)?|.*?\bplay=..., inserting the text /movie/(?:[\w-]+/)?| after the |
  • save it back to the archive
  • delete any pre-compiled version of the file, such as youtube_dl/extractor/sbs.pyo or .../sbs.pyc
  • rename the archive back to youtube-dl.exe.

dirkf avatar Dec 07 '21 01:12 dirkf

Dirkf,

Thanks for this detail, which I'll have a go at if the patch solution can't be used.

I have this version of patch.exe: C:\Program Files (x86)\GCC for Renesas RX 4.8.4.201801-GNURX-ELF\Other Utilities\patch.exe dated 6-Mar-2018.

Assuming that's the patch program you're referring to, how would I use that to patch youtube-dl.exe?

Many thanks for your efforts to help me!

Regards, Daniel


From: dirkf @.*** Sent: 7 December 2021 12:34 PM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

When the extractor may have worked in the past, it would have been with URLs like .../video/..., but the problem URL has .../movie/stuff/...

To support the movie URL, the line of code prefixed by - has to be changed to the one prefixed with +. A command-line program called patch is generally used to do this, but as it's only a small change this isn't necessary. This is good because that program will only be found in Windows if some Unix-y development tools have been installed.

As a Windows user, you probably have the single executable file https://github.com/ytdl-org/youtube-dl/releases/download/2021.06.06/youtube-dl.exe version, youtube-dl.exe ~1.8MB, though other https://pypi.org/project/youtube_dl/ installation https://community.chocolatey.org/packages/youtube-dl types are possible.

Currently the maintainers are not making new releases so patching or rebuilding are the only ways to change the code.

Fortunately it should be possible to use a Windows archive utility to patch the code. The idea is that you find open youtube-dl.exe in the archiver, then, similar to the instructions here https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-981353433 and guidance in the surrounding discussion:

  • rename it to youtube-dl.zip
  • edit the relevant file (in this case youtube_dl/extractor/sbs.py) in the renamed self-extracting archive
  • as you can see, the text in the URL pattern ...(?:single/)?|.?\bplay=... has to be changed to ...(?:single/)?|/movie/(?:[\w-]+/)?|.?\bplay=..., inserting the text /movie/(?:[\w-]+/)?| after the |
  • save it back to the archive
  • delete any pre-compiled version of the file, such as youtube_dl/extractor/sbs.pyo or .../sbs.pyc
  • rename the archive back to youtube-dl.exe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987486615 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M4ILNBLUY54WJZ5KQLUPVQCFANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4M6EYQA6HFRHZYVOOPLUPVQCFA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLN5TFY.gif

DanielTheGreat avatar Dec 07 '21 03:12 DanielTheGreat

That will only work on the expanded source. Better follow the instructions given.

You could adapt them by replacing the step that edits the file with one that extracts the sbs.py, runs patch on it, then saves it back, but you're on your own.

dirkf avatar Dec 07 '21 10:12 dirkf

OK, thanks again for your advice. I'll give that a go over the next day or so and let you know how I go.

Regards, Daniel


From: dirkf @.*** Sent: 7 December 2021 9:32 PM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

That will only work on the expanded source. Better follow the instructions given.

You could adapt them by replacing the step that edits the file with one that extracts the sbs.py, runs patch on it, then saves it back, but you're on your own.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987787227 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M42O3I7Z46RHTW73RLUPXPCJANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4M5ND23S47PQMNAOTW3UPXPCJA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLQG7WY.gif

DanielTheGreat avatar Dec 07 '21 11:12 DanielTheGreat

I just had a look at your previous detailed instructions for manually patching sbs.py to ensure I understood the steps, prior to heading for bed so I could tackle this tomorrow with a clear head.

But when I open youtube-dl.exe with 7-Zip, I find that all the files in Youtube-dl.exe\youtube_dl\extractor\ are .pyo files, including sbs.pyo. I gather (from the web page you linked) that these are some sort of compiled version, so I'm not sure how I would edit them along the lines you indicated.

Where would I find a plain text sbs.py file that I could edit, and then substitute for the .pyo version in Youtube-dl.exe\youtube_dl\extractor. Would that even work with all the other files in Youtube-dl.exe\youtube_dl\extractor\ being .pyo, with only sbs being .py?

Regards, Daniel


From: dirkf @.*** Sent: 7 December 2021 9:32 PM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

That will only work on the expanded source. Better follow the instructions given.

You could adapt them by replacing the step that edits the file with one that extracts the sbs.py, runs patch on it, then saves it back, but you're on your own.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987787227 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M42O3I7Z46RHTW73RLUPXPCJANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4M5ND23S47PQMNAOTW3UPXPCJA5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLQG7WY.gif

DanielTheGreat avatar Dec 07 '21 11:12 DanielTheGreat

https://github.com/ytdl-org/youtube-dl/raw/master/youtube_dl/extractor/sbs.py

I believe that Python will just accept the .py version instead of the (optimised byte-code) .pyo. When youtube-dl.exe runs, it will take immeasurably longer to start as Python has to process the source version.

dirkf avatar Dec 07 '21 11:12 dirkf

Wow, thanks for your very quick reply!

I have downloaded that file and looked at it, and I can now see what needs to be changed. Too tired to do it now (mistake-prone), so I'll edit and test tomorrow and let you know if it works.

Regards, Daniel


From: dirkf @.*** Sent: 7 December 2021 10:54 PM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

https://github.com/ytdl-org/youtube-dl/raw/master/youtube_dl/extractor/sbs.py

I believe that Python will just accept the .py version instead of the (optimised byte-code) .pyo. When youtube-dl.exe runs, it will take immeasurably longer to start as Python has to process the source version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987855550 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M6HGXJRKFOJRRMXP23UPXYU3ANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4MYJPG6GATYHMGGJYALUPXYU3A5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLQXVPQ.gif

DanielTheGreat avatar Dec 07 '21 12:12 DanielTheGreat

Dirk,

Many thanks for all your help, and patience with me! Following your instructions and some advice from the web thread you linked, I finally succeeded in substituting the modified sbs.py for the original sbs.pyo.

And then succeeded in downloading that SBS On-Demand video using the 'new' youtube-dl.exe. The program didn't seem to take any longer to start downloading - I suppose because the sbs.py file is only small - though it took quite a while to download the 108-minute/1.23GB video.

Thanks again.

Regards, Daniel


From: dirkf @.*** Sent: 7 December 2021 10:54 PM To: ytdl-org/youtube-dl Cc: DanielTheGreat; Author Subject: Re: [ytdl-org/youtube-dl] ERROR: Unsupported URL (Issue #30325)

https://github.com/ytdl-org/youtube-dl/raw/master/youtube_dl/extractor/sbs.py

I believe that Python will just accept the .py version instead of the (optimised byte-code) .pyo. When youtube-dl.exe runs, it will take immeasurably longer to start as Python has to process the source version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-987855550 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEA4M6HGXJRKFOJRRMXP23UPXYU3ANCNFSM5JOQD4FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/AEEA4MYJPG6GATYHMGGJYALUPXYU3A5CNFSM5JOQD4FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLQXVPQ.gif

DanielTheGreat avatar Dec 08 '21 11:12 DanielTheGreat

The program didn't seem to take any longer to start downloading

As expected, a few ms at most.

dirkf avatar Dec 08 '21 11:12 dirkf

Hi:

I just have the Windows binaries. Is there a version of the Windows binaries that supports these changes?

No, I'm afraid this got lost before I acquired commit privileges. You'll have to follow what Daniel did above, or wait for a new version.

dirkf avatar Dec 04 '22 23:12 dirkf

Okay, thanks very much for that and for all your hard work. Great program.

Do you have any guess as to when a new version might come out?

On Sun, Dec 4, 2022 at 6:56 PM dirkf @.***> wrote:

No, I'm afraid this got lost before I acquired commit privileges. You'll have to follow what Daniel did above, or wait for a new version.

— Reply to this email directly, view it on GitHub https://github.com/ytdl-org/youtube-dl/issues/30325#issuecomment-1336555563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBMBCBLSPAYBJLIDYCXTD3WLUVRNANCNFSM5JOQD4FA . You are receiving this because you commented.Message ID: @.***>

-- Brad Karal

Hi, I'm seeing the same issue with this video URL from Rumble: https://rumble.com/v26nj3q-worldwide-governments-are-attacking-their-own-citizens-with-an-injectable-b.html. I'm debugging now but I'm coming at this cold.

teddis avatar Jan 22 '23 18:01 teddis

When I tried the method above to replace the .pyo file, my archive program (7-Zip) threw an error that the file is read-only. What am I missing?

You may need to use WinZip, as in the linked instructions (IIRC).

dirkf avatar Jan 23 '23 01:01 dirkf

Hi, I'm seeing the same issue with this video URL from Rumble:...

No, you just need to install the git master, which supports embedded Rumble stuff.

dirkf avatar Jan 23 '23 01:01 dirkf

@dirkf I believe I have the latest v2021.12.17 installed with brew, and Rumble is failing. Is there a more recent version? I cloned and appears there's nothing more recent.

teddis avatar Jan 23 '23 02:01 teddis

The most up-to-date code isn't available through brew. Hence "install the git master".

dirkf avatar Mar 15 '23 05:03 dirkf

Superseded by #31841.

dirkf avatar Mar 23 '23 23:03 dirkf