[arte] adapt to browser2
* use of browser 2 * choose between videos version (ie: subtitles or not) * support of cinema.arte.tv
This commit is contained in:
parent
11a63c33ce
commit
cdc4410170
5 changed files with 485 additions and 369 deletions
|
|
@ -17,21 +17,36 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.base import enum
|
||||
from weboob.capabilities.video import BaseVideo
|
||||
|
||||
FORMATS = enum(HTTP_MP4=u'HBBTV', HLS=u'M3U8', RTMP=u'RTMP', HLS_MOBILE=u'MOBILE')
|
||||
|
||||
LANG = enum(FRENCH={u'label': u'French', u'webservice': u'F', u'site': u'fr', u'version': u'1', u'title': u'titleFR'},
|
||||
GERMAN={u'label': u'German', u'webservice': u'D', u'site': u'de', u'version': u'1', u'title': u'titleDE'})
|
||||
|
||||
SITE = enum(PROGRAM={u'id': u'program', u'label': u'Arte Programs', 1: 'get_arte_programs',
|
||||
2: 'get_arte_program_videos', u'video': 'get_video_from_program_id'},
|
||||
CONCERT={u'id': u'concert', u'label': u'Arte Concert videos', 1: 'get_arte_concert_categories',
|
||||
2: 'get_arte_concert_videos', 'video': 'get_arte_concert_video'},
|
||||
CINEMA={u'id': u'cinema', u'label': u'Arte Cinema', 1: 'get_arte_cinema_categories',
|
||||
2: 'get_arte_cinema_categories', 3: 'get_arte_cinema_videos', 'video': 'get_arte_cinema_video'})
|
||||
|
||||
QUALITY = enum(HD=u'SQ', MD=u'EQ', SD=u'MQ', LD=u'LQ')
|
||||
|
||||
VERSION_VIDEO = enum(VOSTA={u'label': u'Original version subtitled (German)', LANG.GERMAN.get('label'): u'3'},
|
||||
VOSTF={u'label': u'Original version subtitled (French)', LANG.FRENCH.get('label'): u'3'},
|
||||
VASTA={u'label': u'Translated version (German)',
|
||||
LANG.GERMAN.get('label'): u'1', LANG.FRENCH.get('label'): u'2'},
|
||||
VFSTF={u'label': u'Translated version (French)',
|
||||
LANG.FRENCH.get('label'): u'1', LANG.GERMAN.get('label'): u'2'},
|
||||
VASTMA={u'label': u'Deaf version (German)', LANG.GERMAN.get('label'): u'8'},
|
||||
VFSTMF={u'label': u'Deaf version (French)', LANG.FRENCH.get('label'): u'8'})
|
||||
|
||||
|
||||
class ArteVideo(BaseVideo):
|
||||
@classmethod
|
||||
def id2url(cls, _id):
|
||||
lang = _id[-1:]
|
||||
return 'http://arte.tv/papi/tvguide/videos/stream/%s/%s/M3U8' % (lang, _id)
|
||||
pass
|
||||
|
||||
|
||||
class ArteLiveVideo(BaseVideo):
|
||||
def __init__(self, _id, *args, **kwargs):
|
||||
BaseVideo.__init__(self, 'live.%s' % _id, *args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def id2url(cls, _id):
|
||||
return 'http://concert.arte.tv%s' % _id
|
||||
class ArteSiteVideo(BaseVideo):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue