From 4eba4586b688e67b37c1938ccdffa9a7b413021c Mon Sep 17 00:00:00 2001 From: Matthew Williams <48567180+maw101@users.noreply.github.com> Date: Fri, 12 Jun 2020 04:05:59 +0100 Subject: [PATCH 1/8] Added save icon to recommended video thumbnails (#490) --- src/js/templates.js | 3 +++ src/style/player.css | 13 +++++++++++++ src/templates/player.html | 11 ++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/js/templates.js b/src/js/templates.js index 8eb96a6ebaf9..330f4edbacc6 100644 --- a/src/js/templates.js +++ b/src/js/templates.js @@ -947,6 +947,9 @@ let playerView = new Vue({ playerView.legacySeen = false; playerView.playerSeen = true; }, + toggleSave: (videoId) => { + addSavedVideo(videoId); + }, copyYouTube: (videoId) => { const url = 'https://youtube.com/watch?v=' + videoId; clipboard.writeText(url); diff --git a/src/style/player.css b/src/style/player.css index 211054c4dced..83e68933a721 100644 --- a/src/style/player.css +++ b/src/style/player.css @@ -263,6 +263,19 @@ iframe { width: 100%; } +.recommendThumbnail i { + color: white; + background-color: black; + padding: 6px; + opacity: 0.7; + position: relative; +} + +.recommendVideoSave { + bottom: 145px; + left: 222px; +} + .recommendTitle { font-size: 16px; font-weight: bold; diff --git a/src/templates/player.html b/src/templates/player.html index be43075ec598..0fc450bad6bf 100644 --- a/src/templates/player.html +++ b/src/templates/player.html @@ -123,14 +123,15 @@
Recommendations
-
+
- +

{{video.duration}}

+
-

{{video.title}}

-

{{video.channelName}}

-

{{video.viewCount}}

+

{{video.title}}

+

{{video.channelName}}

+

{{video.viewCount}}


From 6bb80090518f8762152a872f2e6a26ab66b6f2f4 Mon Sep 17 00:00:00 2001 From: Preston Date: Wed, 24 Jun 2020 22:32:32 -0400 Subject: [PATCH 2/8] Update ytdl-core and fix Invidious legacy video links --- package-lock.json | 37 ++++++++++++++++++++++--------------- package.json | 2 +- src/js/player.js | 4 ++-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a9142abd4ad..b93c2b9cc5ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3386,9 +3386,9 @@ } }, "html-entities": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", - "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.1.tgz", + "integrity": "sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA==" }, "http-cache-semantics": { "version": "4.0.3", @@ -4003,12 +4003,19 @@ } }, "m3u8stream": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/m3u8stream/-/m3u8stream-0.6.3.tgz", - "integrity": "sha512-HNUco8ef9kOvMRH7tYxJqbk9IuRA+AuZG8a/dQwqI+jfuEs1/DUaPbfTIlUDB4JmTZNkTOZHvZI5TvnQGR8nKA==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/m3u8stream/-/m3u8stream-0.7.1.tgz", + "integrity": "sha512-z6ldnAdhbuWOL6LmMkwptSZGzj+qbRytMKLTbNicwF/bJMjf9U9lqD57RNQUFecvWadEkzy6PDjcNJFFgi19uQ==", "requires": { "miniget": "^1.6.1", "sax": "^1.2.4" + }, + "dependencies": { + "miniget": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/miniget/-/miniget-1.7.2.tgz", + "integrity": "sha512-USPNNK2bnHLOplX8BZVMehUkyQizS/DFpBdoH0TS+fM+hQoLNg9tWg4MeY9wE8gfY0pbzmx5UBEODujt3Lz8AA==" + } } }, "make-dir": { @@ -4087,9 +4094,9 @@ "dev": true }, "miniget": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/miniget/-/miniget-1.6.1.tgz", - "integrity": "sha512-I5oBwZmcaOuJrjQn7lpS29HM+aAZDbzKbX5ouxVyhFYdg6fA6YKOTwOCgzZQwlHuMek3FlCxz6eNrd4pOXbwOA==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/miniget/-/miniget-2.0.0.tgz", + "integrity": "sha512-JAHY/3Dv673TFDmYcpF3yo755ViTy0fU2L0j9y+5bobs6+fbnX4k8UkmCqC8mwwgYUNDOEgHrN1P/oO+rQNxjw==" }, "minimatch": { "version": "3.0.4", @@ -5680,13 +5687,13 @@ } }, "ytdl-core": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-1.0.3.tgz", - "integrity": "sha512-sBOVokjrAigKTEn248MJ+JpS5ifay/vBzYGMDeZhG61xmgthev6yHXBgEgm+M8ySDQXXVjOTmUtY3GHbX988KA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-3.1.1.tgz", + "integrity": "sha512-sHw8Vz56Bs7LRKhJARW8j2JREndHFBuEdnYKgjx4RHwh1t75TsdZ5/SRpz9TLkNm2M5S8gVwvWm7AD1blhjb0g==", "requires": { - "html-entities": "^1.1.3", - "m3u8stream": "^0.6.3", - "miniget": "^1.6.0", + "html-entities": "^1.3.1", + "m3u8stream": "^0.7.1", + "miniget": "^2.0.0", "sax": "^1.1.3" } } diff --git a/package.json b/package.json index 5d49aa7592d4..fad384b91560 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,6 @@ "nedb": "^1.8.0", "opml-to-json": "0.0.3", "vue": "^2.6.10", - "ytdl-core": "^1.0.3" + "ytdl-core": "^3.1.1" } } diff --git a/src/js/player.js b/src/js/player.js index e08fe7a88b60..844f69add1a7 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -399,11 +399,11 @@ function playVideo(videoId, playlistId = '') { // Search through the returned object to get the 360p and 720p video URLs (If available) videoUrls.forEach((video) => { switch (video.itag) { - case 18: + case '18': playerView.video360p = decodeURIComponent(video.url); // ft.log(playerView.video360p); break; - case 22: + case '22': playerView.video720p = decodeURIComponent(video.url); // ft.log(playerView.video720p); break; From f96bee7768e0087e704fbba816f5c5ed5e123adf Mon Sep 17 00:00:00 2001 From: Preston Date: Thu, 25 Jun 2020 13:54:50 -0400 Subject: [PATCH 3/8] Fix premiere text --- src/js/videos.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/videos.js b/src/js/videos.js index 6b6e81d85000..86980e3a246f 100644 --- a/src/js/videos.js +++ b/src/js/videos.js @@ -155,8 +155,9 @@ function displayVideo(videoData, listType = '') { let published = new Date(videoData.published * 1000); let hours = 0; - if (now < published.getTime()) { - video.publishedDate = 'Premieres on ' + published.toLocaleString(); + if (videoData.isUpcoming) { + const premiereDate = new Date(videoData.premiereTimestamp * 1000); + video.publishedDate = 'Premieres on ' + premiereDate.toLocaleString(); } else { if (time >= 3600) { hours = Math.floor(time / 3600); From 609c4b3bf849c6703b0ef5099de2633ccdef40ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2020 14:00:20 -0400 Subject: [PATCH 4/8] Bump acorn from 6.3.0 to 6.4.1 (#461) Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.3.0...6.4.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index b93c2b9cc5ac..48b15e5326b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -140,9 +140,9 @@ "integrity": "sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg==" }, "acorn": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" }, "acorn-globals": { "version": "4.3.4", @@ -154,9 +154,9 @@ }, "dependencies": { "acorn": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", - "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" } } }, @@ -4255,7 +4255,7 @@ "dependencies": { "sax": { "version": "0.6.1", - "resolved": "http://registry.npmjs.org/sax/-/sax-0.6.1.tgz", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=" } } From a6e5c0eac07e83eaa530b15ad8f7951abb51a942 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2020 14:00:31 -0400 Subject: [PATCH 5/8] Bump jquery from 3.4.1 to 3.5.0 (#470) Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/jquery/jquery/releases) - [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48b15e5326b8..a61c53f81add 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3611,9 +3611,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "jquery": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.0.tgz", + "integrity": "sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==" }, "js-yaml": { "version": "3.13.1", diff --git a/package.json b/package.json index fad384b91560..901813189c29 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "commonjs": "0.0.1", "dateformat": "^3.0.3", "electron-context-menu": "^0.15.0", - "jquery": "^3.4.1", + "jquery": "^3.5.0", "jsdom": "^15.2.0", "mustache": "^3.1.0", "nedb": "^1.8.0", From f1c9214f65c52696aece62748328712fac8a85af Mon Sep 17 00:00:00 2001 From: Kyle Watson Date: Thu, 25 Jun 2020 19:07:47 +0100 Subject: [PATCH 6/8] Added 'current time' option to share menu as a checkbox. (#468) Co-authored-by: Kyle --- src/js/templates.js | 20 +++++++++++++++----- src/templates/player.html | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/js/templates.js b/src/js/templates.js index 330f4edbacc6..f176bd6863f2 100644 --- a/src/js/templates.js +++ b/src/js/templates.js @@ -893,7 +893,8 @@ let playerView = new Vue({ playlistShowList: true, recommendedVideoList: [], playlistVideoList: [], - distractionFreeMode: false + distractionFreeMode: false, + includeCurrentTime: false }, methods: { channel: (channelId) => { @@ -951,12 +952,12 @@ let playerView = new Vue({ addSavedVideo(videoId); }, copyYouTube: (videoId) => { - const url = 'https://youtube.com/watch?v=' + videoId; + const url = 'https://youtube.com/watch?v=' + videoId + currentTimeParameter(); clipboard.writeText(url); showToast('URL has been copied to the clipboard'); }, openYouTube: (videoId) => { - shell.openExternal('https://youtube.com/watch?v=' + videoId); + shell.openExternal('https://youtube.com/watch?v=' + videoId + currentTimeParameter()); }, openYouTubeNoCookie: (videoId) => { const url = 'https://www.youtube-nocookie.com/embed/' + videoId; @@ -968,12 +969,12 @@ let playerView = new Vue({ showToast('URL has been copied to the clipboard'); }, copyInvidious: (videoId) => { - const url = invidiousInstance + '/watch?v=' + videoId; + const url = invidiousInstance + '/watch?v=' + videoId + currentTimeParameter(); clipboard.writeText(url); showToast('URL has been copied to the clipboard'); }, openInvidious: (videoId) => { - shell.openExternal(invidiousInstance + '/watch?v=' + videoId); + shell.openExternal(invidiousInstance + '/watch?v=' + videoId + currentTimeParameter()); }, save: (videoId) => { toggleSavedVideo(videoId); @@ -1789,3 +1790,12 @@ function hideViews() { editProfileView.seen = false; backButtonView.lastView = false; } + +function currentTimeParameter(){ + if (!playerView.includeCurrentTime) return ""; + if (typeof (playerView.currentTime) !== 'undefined') return "&t=" + Math.floor(playerView.currentTime); + if (typeof (player) !== 'undefined') return "&t=" + Math.floor(player.currentTime); + const legacyPlayer = $('#legacyPlayer').get(0); + if (typeof (legacyPlayer) !== 'undefined') return "&t=" + Math.floor(legacyPlayer.currentTime); + return ""; +} \ No newline at end of file diff --git a/src/templates/player.html b/src/templates/player.html index 0fc450bad6bf..c6e137a28eef 100644 --- a/src/templates/player.html +++ b/src/templates/player.html @@ -61,6 +61,8 @@