Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[cspan] add support for brightcove free live streams #13028
Comments
|
It looks like this is an issue with CSPAN livestreams, rather than recorded ones.
Let me know if anyone needs the full dump of the HTML pages during the livestream. I took a quick look and I'm not sure that all the necessary information to construct a brightcove URL is in the above |
|
after modifying
|
|
Yeah, it sounds like there are two issues:
Thanks. |
|
@remitamine: Does not work for me:
|
|
Serving the previously-saved HTML locally, and with a small tweak, I see instead: class CSpanIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?c-span\.org/video/\?(?P<id>[0-9a-f]+)'
+ _VALID_URL = r'https?://(?:www\.|localhost\.)?c-span\.org/video/\?(?P<id>[0-9a-f]+)'
Is this correct? C-SPAN shouldn't require provider credentials to view their content at SD resolution, only at HD, I think? I am not exactly sure how this works, but it certainly works in a browser without credentials. |
|
i don't think that the restriction is related to the quality, it is related to weather the served stream is live or replay. |
|
I watched the livestream via brightcove in my browser without provider credentials this afternoon. Here's a screenshot of the control-click information from the brightcove browser player: C-SPAN documents their quality restriction here: Online access to our three television channels (C‑SPAN, C‑SPAN2, and C‑SPAN3) is reserved for cable or satellite TV customers. |
|
so the SD quality is served using
|
|
I think I am a little confused how you ended up with accountid 3617315736001 instead of 3162030207001, but I agree that works. Edit: Oh, I see, that's from my screenshot. Also, it seemed to me that 5996d21 hardcoded a bunch of stuff (like the '7001 id) without being very clear about where it came from, and I wasn't sure why |
when i enter one of the live pages, it defaults to the live stream but if you click on
|
they represent the current values used by website for now, and it better to provide them as fallback rather than failing. |
|
For what it's worth, looking at https://www.c-span.org/video/?428302-1/senate-democrats-lose-confidence-rod-rosenstein&live right now, current HEAD tries this:
but it should be the '6001 account ID instead of the '7001. Changing the code to override that and print a URL, we get this failure:
And apparently the embed code is the issue. Either using
or
so fyi. |
|
this patch will enable the free SD streams instead of HD streams: diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py
index 171820e27..14602e0fb 100644
--- a/youtube_dl/extractor/cspan.py
+++ b/youtube_dl/extractor/cspan.py
@@ -87,10 +87,10 @@ class CSpanIE(InfoExtractor):
if bc:
bc_attr = extract_attributes(bc)
bc_url = self.BRIGHTCOVE_URL_TEMPLATE % (
- bc_attr.get('data-bcaccountid', '3162030207001'),
- bc_attr.get('data-noprebcplayerid', 'SyGGpuJy3g'),
- bc_attr.get('data-newbcplayerid', 'default'),
- bc_attr['data-bcid'])
+ bc_attr.get('data-altbcaccountid', '3617315736001'),
+ bc_attr.get('data-altnoprebcplayerid', 'S1eEqdyJ2e'),
+ bc_attr.get('data-altnewbcplayerid', 'default'),
+ bc_attr['data-altbcid'])
return self.url_result(smuggle_url(bc_url, {'source_url': url}))
# We first look for clipid, because clipprog always appears before
|
|
Is anything holding up @remitamine's patch? |
making the change in #13028 (comment) will make it impossible for users to get the HD stream, so the prefered way is to try to use the HD streams and fallback to SD stream in case of an error. |

(Sorry, this Issue was submitted prematurely. Now done editing. Sorry for any confusion.)
Description of your issue, suggested solution and other information
It appears that current live CSPAN videos are now Brightcove videos that don't work either with the cspan extractor or with the generic extractor. Two examples:
https://www.c-span.org/video/?427577-1/sally-yates-james-clapper-testify-russian-interference-2016-election&live
and
https://www.c-span.org/video/?427706-1/fourth-circuit-hears-oral-argument-travel-ban&live
Looks like the HTML has:
or
This also fails with
--force-generic, i.e. with the Brightcove embed search in the generic extractor: