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.

33 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class LearnrIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?learnr\.pro/view/video/(?P<id>[0-9]+)'
  6. _TEST = {
  7. 'url': 'http://www.learnr.pro/view/video/51624-web-development-tutorial-for-beginners-1-how-to-build-webpages-with-html-css-javascript',
  8. 'md5': '3719fdf0a68397f49899e82c308a89de',
  9. 'info_dict': {
  10. 'id': '51624',
  11. 'ext': 'mp4',
  12. 'title': 'Web Development Tutorial for Beginners (#1) - How to build webpages with HTML, CSS, Javascript',
  13. 'description': 'md5:b36dbfa92350176cdf12b4d388485503',
  14. 'uploader': 'LearnCode.academy',
  15. 'uploader_id': 'learncodeacademy',
  16. 'upload_date': '20131021',
  17. },
  18. 'add_ie': ['Youtube'],
  19. }
  20. def _real_extract(self, url):
  21. video_id = self._match_id(url)
  22. webpage = self._download_webpage(url, video_id)
  23. return {
  24. '_type': 'url_transparent',
  25. 'url': self._search_regex(
  26. r"videoId\s*:\s*'([^']+)'", webpage, 'youtube id'),
  27. 'id': video_id,
  28. }