You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class FreespeechIE(InfoExtractor):
  4. IE_NAME = 'freespeech.org'
  5. _VALID_URL = r'https?://(?:www\.)?freespeech\.org/stories/(?P<id>.+)'
  6. _TEST = {
  7. 'add_ie': ['Youtube'],
  8. 'url': 'http://www.freespeech.org/stories/fcc-announces-net-neutrality-rollback-whats-stake/',
  9. 'info_dict': {
  10. 'id': 'waRk6IPqyWM',
  11. 'ext': 'mp4',
  12. 'title': 'What\'s At Stake - Net Neutrality Special',
  13. 'description': 'Presented by MNN and FSTV',
  14. 'upload_date': '20170728',
  15. 'uploader_id': 'freespeechtv',
  16. 'uploader': 'freespeechtv',
  17. },
  18. }
  19. def _real_extract(self, url):
  20. display_id = self._match_id(url)
  21. webpage = self._download_webpage(url, display_id)
  22. youtube_url = self._search_regex(
  23. r'data-video-url="([^"]+)"',
  24. webpage, 'youtube url')
  25. return {
  26. '_type': 'url',
  27. 'url': youtube_url,
  28. 'ie_key': 'Youtube',
  29. }