Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External 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
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
355ef10a
Commit
355ef10a
authored
5 years ago
by
Christophe Simonis
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] website_slides: correctly forward-port
cfa1e101
parent
e6cf33bd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/website_slides/models/slide_slide.py
+10
-5
10 additions, 5 deletions
addons/website_slides/models/slide_slide.py
with
10 additions
and
5 deletions
addons/website_slides/models/slide_slide.py
+
10
−
5
View file @
355ef10a
...
...
@@ -553,11 +553,16 @@ class Slide(models.Model):
return
result
def
_find_document_data_from_url
(
self
,
url
):
expr
=
re
.
compile
(
r
'
^.*((youtu.be/)|(v/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*
'
)
arg
=
expr
.
match
(
url
)
document_id
=
arg
and
arg
.
group
(
7
)
or
False
if
document_id
:
return
(
'
youtube
'
,
document_id
)
url_obj
=
urls
.
url_parse
(
url
)
if
url_obj
.
ascii_host
==
'
youtu.be
'
:
return
(
'
youtube
'
,
url_obj
.
path
[
1
:]
if
url_obj
.
path
else
False
)
elif
url_obj
.
ascii_host
in
(
'
youtube.com
'
,
'
www.youtube.com
'
,
'
m.youtube.com
'
):
v_query_value
=
url_obj
.
decode_query
().
get
(
'
v
'
)
if
v_query_value
:
return
(
'
youtube
'
,
v_query_value
)
split_path
=
url_obj
.
path
.
split
(
'
/
'
)
if
len
(
split_path
)
>=
3
and
split_path
[
1
]
in
(
'
v
'
,
'
embed
'
):
return
(
'
youtube
'
,
split_path
[
2
])
expr
=
re
.
compile
(
r
'
(^https:\/\/docs.google.com|^https:\/\/drive.google.com).*\/d\/([^\/]*)
'
)
arg
=
expr
.
match
(
url
)
...
...
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