Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
Youtube Dl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Youtube Dl
Commits
d214fdb8
Commit
d214fdb8
authored
11 years ago
by
Jaime Marquínez Ferrándiz
Browse files
Options
Downloads
Patches
Plain Diff
[brightcove] Don't use 'or' with the xml nodes, use the 'value' attribute instead
parent
138df537
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
youtube_dl/extractor/brightcove.py
+7
-4
7 additions, 4 deletions
youtube_dl/extractor/brightcove.py
with
7 additions
and
4 deletions
youtube_dl/extractor/brightcove.py
+
7
−
4
View file @
d214fdb8
...
@@ -76,18 +76,21 @@ class BrightcoveIE(InfoExtractor):
...
@@ -76,18 +76,21 @@ class BrightcoveIE(InfoExtractor):
'
playerID
'
:
find_xpath_attr
(
object_doc
,
'
./param
'
,
'
name
'
,
'
playerID
'
).
attrib
[
'
value
'
],
'
playerID
'
:
find_xpath_attr
(
object_doc
,
'
./param
'
,
'
name
'
,
'
playerID
'
).
attrib
[
'
value
'
],
}
}
def
find_param
(
name
):
def
find_param
(
name
):
return
find_xpath_attr
(
object_doc
,
'
./param
'
,
'
name
'
,
name
)
node
=
find_xpath_attr
(
object_doc
,
'
./param
'
,
'
name
'
,
name
)
if
node
is
not
None
:
return
node
.
attrib
[
'
value
'
]
return
None
playerKey
=
find_param
(
'
playerKey
'
)
playerKey
=
find_param
(
'
playerKey
'
)
# Not all pages define this value
# Not all pages define this value
if
playerKey
is
not
None
:
if
playerKey
is
not
None
:
params
[
'
playerKey
'
]
=
playerKey
.
attrib
[
'
value
'
]
params
[
'
playerKey
'
]
=
playerKey
# The three fields hold the id of the video
# The three fields hold the id of the video
videoPlayer
=
find_param
(
'
@videoPlayer
'
)
or
find_param
(
'
videoId
'
)
or
find_param
(
'
videoID
'
)
videoPlayer
=
find_param
(
'
@videoPlayer
'
)
or
find_param
(
'
videoId
'
)
or
find_param
(
'
videoID
'
)
if
videoPlayer
is
not
None
:
if
videoPlayer
is
not
None
:
params
[
'
@videoPlayer
'
]
=
videoPlayer
.
attrib
[
'
value
'
]
params
[
'
@videoPlayer
'
]
=
videoPlayer
linkBase
=
find_param
(
'
linkBaseURL
'
)
linkBase
=
find_param
(
'
linkBaseURL
'
)
if
linkBase
is
not
None
:
if
linkBase
is
not
None
:
params
[
'
linkBaseURL
'
]
=
linkBase
.
attrib
[
'
value
'
]
params
[
'
linkBaseURL
'
]
=
linkBase
data
=
compat_urllib_parse
.
urlencode
(
params
)
data
=
compat_urllib_parse
.
urlencode
(
params
)
return
cls
.
_FEDERATED_URL_TEMPLATE
%
data
return
cls
.
_FEDERATED_URL_TEMPLATE
%
data
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment