Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backups
youtube-dl
Commits
82ef02e9
Unverified
Commit
82ef02e9
authored
Sep 19, 2020
by
Sergey M․
Browse files
[telequebec] Fix issues (closes #26368)
parent
b856b399
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
youtube_dl/extractor/telequebec.py
youtube_dl/extractor/telequebec.py
+37
-16
No files found.
youtube_dl/extractor/telequebec.py
View file @
82ef02e9
...
...
@@ -12,23 +12,24 @@ from ..utils import (
class
TeleQuebecBaseIE
(
InfoExtractor
):
BRIGHTCOVE_URL_TEMPLATE
=
'http://players.brightcove.net/6150020952001/default_default/index.html?videoId=%s'
@
staticmethod
def
_
limelight_result
(
media_id
):
def
_
result
(
url
,
ie_key
):
return
{
'_type'
:
'url_transparent'
,
'url'
:
smuggle_url
(
'limelight:media:'
+
media_id
,
{
'geo_countries'
:
[
'CA'
]}),
'ie_key'
:
'LimelightMedia'
,
'url'
:
smuggle_url
(
url
,
{
'geo_countries'
:
[
'CA'
]}),
'ie_key'
:
ie_key
,
}
def
_brightcove_result
(
self
,
brightcove_id
):
return
self
.
url_result
(
smuggle_url
(
self
.
BRIGHTCOVE_URL_TEMPLATE
%
brightcove_id
,
{
'geo_countries'
:
[
'CA'
]}),
'BrightcoveNew'
,
brightcove_id
)
@
staticmethod
def
_limelight_result
(
media_id
):
return
TeleQuebecBaseIE
.
_result
(
'limelight:media:'
+
media_id
,
'LimelightMedia'
)
@
staticmethod
def
_brightcove_result
(
brightcove_id
):
return
TeleQuebecBaseIE
.
_result
(
'http://players.brightcove.net/6150020952001/default_default/index.html?videoId=%s'
%
brightcove_id
,
'BrightcoveNew'
)
class
TeleQuebecIE
(
TeleQuebecBaseIE
):
...
...
@@ -51,6 +52,22 @@ class TeleQuebecIE(TeleQuebecBaseIE):
'params'
:
{
'skip_download'
:
True
,
},
},
{
'url'
:
'https://zonevideo.telequebec.tv/media/55267/le-soleil/passe-partout'
,
'info_dict'
:
{
'id'
:
'6167180337001'
,
'ext'
:
'mp4'
,
'title'
:
'Le soleil'
,
'description'
:
'md5:64289c922a8de2abbe99c354daffde02'
,
'uploader_id'
:
'6150020952001'
,
'upload_date'
:
'20200625'
,
'timestamp'
:
1593090307
,
},
'params'
:
{
'format'
:
'bestvideo'
,
'skip_download'
:
True
,
},
'add_ie'
:
[
'BrightcoveNew'
],
},
{
# no description
'url'
:
'http://zonevideo.telequebec.tv/media/30261'
,
...
...
@@ -67,10 +84,14 @@ class TeleQuebecIE(TeleQuebecBaseIE):
'https://mnmedias.api.telequebec.tv/api/v2/media/'
+
media_id
,
media_id
)[
'media'
]
if
media_data
[
'streamInfo'
][
'source'
]
==
'Brightcove'
:
info
=
self
.
_brightcove_result
(
media_data
[
'streamInfo'
][
'sourceId'
])
elif
media_data
[
'streamInfo'
][
'source'
]
==
'Limelight'
:
info
=
self
.
_limelight_result
(
media_data
[
'streamInfo'
][
'sourceId'
])
source_id
=
media_data
[
'streamInfo'
][
'sourceId'
]
source
=
(
try_get
(
media_data
,
lambda
x
:
x
[
'streamInfo'
][
'source'
],
compat_str
)
or
'limelight'
).
lower
()
if
source
==
'brightcove'
:
info
=
self
.
_brightcove_result
(
source_id
)
else
:
info
=
self
.
_limelight_result
(
source_id
)
info
.
update
({
'title'
:
media_data
.
get
(
'title'
),
'description'
:
try_get
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment