From 8521f0408709b26ce57e707f179721d9f78a6807 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 5 Jun 2019 11:10:23 -0500 Subject: [PATCH] Use short URL for sharing videos --- assets/js/player.js | 3 ++- src/invidious/videos.cr | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index 060400c90..823721855 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -25,12 +25,13 @@ if (player_data.aspect_ratio) { var embed_url = new URL(location); embed_url.searchParams.delete('v'); +short_url = location.origin + '/' + video_data.id + embed_url.search; embed_url = location.origin + '/embed/' + video_data.id + embed_url.search; var shareOptions = { socials: ["fbFeed", "tw", "reddit", "email"], - url: window.location.href, + url: short_url, title: player_data.title, description: player_data.description, image: player_data.thumbnail, diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 99c6df5c0..92787fdca 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -1240,7 +1240,7 @@ def process_video_params(query, preferences) quality = query["quality"]? region = query["region"]? related_videos = query["related_videos"]? && (query["related_videos"] == "true" || query["related_videos"] == "1").to_unsafe - speed = query["speed"]?.try &.to_f? + speed = query["speed"]?.try &.rchop("x").to_f? video_loop = query["loop"]?.try &.to_i? volume = query["volume"]?.try &.to_i?