Browse Source

[ruv] Add extractor

master-ytdl-org
Orn 8 years ago
committed by Sergey M․
parent
commit
a1de83e5f0
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
2 changed files with 32 additions and 0 deletions
  1. +1
    -0
      youtube_dl/extractor/extractors.py
  2. +31
    -0
      youtube_dl/extractor/ruv.py

+ 1
- 0
youtube_dl/extractor/extractors.py View File

@ -875,6 +875,7 @@ from .rutube import (
) )
from .rutv import RUTVIE from .rutv import RUTVIE
from .ruutu import RuutuIE from .ruutu import RuutuIE
from .ruv import RuvIE
from .sandia import SandiaIE from .sandia import SandiaIE
from .safari import ( from .safari import (
SafariIE, SafariIE,


+ 31
- 0
youtube_dl/extractor/ruv.py View File

@ -0,0 +1,31 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class RuvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ruv\.is/sarpurinn/ruv/\w+/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://ruv.is/sarpurinn/ruv/frettir/20170614',
'md5': 'a07ea1ebaba64082d90323b1c96f264b',
'info_dict': {
'id': '20170614',
'ext': 'mp4',
'title': 'Fréttir',
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._og_search_title(webpage)
video_url = self._html_search_regex(r'video\.src\s*=\s*["\'](.+?)["\']', webpage, 'video URL')
return {
'id': video_id,
'title': title,
'url': video_url,
'ext': 'mp4'
}

Loading…
Cancel
Save