Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SenateFloorGranicus] Add new extractor #22181

Closed
wants to merge 1 commit into from

Conversation

galgeek
Copy link
Contributor

@galgeek galgeek commented Aug 22, 2019

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

A new extractor enabling download of US Senate videos linked from https://www.senate.gov/floor/ and hosted by granicus.com.

This PR addresses recent comments at issue #13399.

@johnhawkinson
Copy link
Contributor

http://archive-media.granicus.com:443/ really? I mean, yes, that does seem to be true, but it also seems like an error that is likely to be corrected in the near future, thus breaking anything that depends on it…

@galgeek
Copy link
Contributor Author

galgeek commented Aug 22, 2019

That's the host documented in this stack overflow from a year ago... admittedly odd!
https://stackoverflow.com/questions/51748091/download-video-from-granicus

http://archive-media.granicus.com/ works, too, now, in a browser window, but test/test_download.py TestDownload.test_SenateFloorGranicus* fails for me without :443:

$ python3 test/test_download.py TestDownload.test_SenateFloorGranicus_1
[SenateFloorGranicus] None: Downloading webpage
[info] Writing video description metadata as JSON to: test_SenateFloorGranicus_1_senate_ff605d76-86c3-4e8d-9991-9f32efd782de.info.json
[debug] Invoking downloader on 'http://archive-media.granicus.com/OnDemand/senate/senate_ff605d76-86c3-4e8d-9991-9f32efd782de.mp4'
[download] Unable to resume
[download] Destination: test_SenateFloorGranicus_1_senate_ff605d76-86c3-4e8d-9991-9f32efd782de.mp4
[download] 100% of 234.00B in 00:00
F
======================================================================
FAIL: test_SenateFloorGranicus_1 (__main__.TestDownload):
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_download.py", line 225, in test_template
    format_bytes(got_fsize)))
  File "/Users/bara/Dev/ytd/youtube-dl/test/helper.py", line 249, in assertGreaterEqual
    self.assertTrue(got >= expected, msg)
AssertionError: False is not true : Expected test_SenateFloorGranicus_1_senate_ff605d76-86c3-4e8d-9991-9f32efd782de.mp4 to be at least 9.77KiB, but it's only 234.00B 

----------------------------------------------------------------------
Ran 1 test in 1.088s

FAILED (failures=1)

I pushed up a small change to VALID_URL to make it just a little easier to remove :443 from the url later, if and when we need to.

@galgeek
Copy link
Contributor Author

galgeek commented Sep 23, 2019

The latest update generalizes URL regexes more. This should make it easier to copy and paste to create extractors for other organizations using granicus.com.

I wonder whether there's an even more general way to write this? I had no luck with a quick try at separate granicus and senate floor extractors.

@galgeek
Copy link
Contributor Author

galgeek commented Oct 22, 2019

The current version of youtube-dl, 2019.10.22, remains unable to download the video at urls like https://floor.senate.gov/MediaPlayer.php?view_id=2&clip_id=3125

This PR, rebased on current master, continues to enable these downloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defunct PR source branch is not accessible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants