Skip to content

Commit

Permalink
properly support vimeo
Browse files Browse the repository at this point in the history
  • Loading branch information
benzkji committed Nov 3, 2024
1 parent c519b3f commit 6e7f296
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions djangocms_baseplugins/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ def save(self):
def populate_oembed_infos(self):
if self.video_type == "youtube":
url = "https://youtube.com/oembed/"
params = {
"format": "json",
"url": self.video_url,
}
if self.video_type == "vimeo":
url = "https://vimeo.com/oembed/"
params = {
"format": "json",
"url": self.video_url,
}
url = "https://vimeo.com/api/oembed.json"
params = {
"url": self.video_url,
}
response = requests.get(url, params)
if response.status_code == 200:
self.oembed_info = response.json()
Expand Down

0 comments on commit 6e7f296

Please sign in to comment.