Skip to content

Commit 8a58087

Browse files
committed
Merge branch 'development'
2 parents f70a419 + 7ad2029 commit 8a58087

File tree

3 files changed

+44
-39
lines changed

3 files changed

+44
-39
lines changed

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "FreeTube",
33
"productName": "FreeTube",
4-
"version": "0.7.1",
4+
"version": "0.7.2",
55
"description": "An Open Source YouTube app for privacy.",
66
"main": "src/js/init.js",
77
"scripts": {
@@ -11,17 +11,20 @@
1111
"make:win": "electron-builder build --win",
1212
"make:win:exe": "electron-builder build --win nsis",
1313
"make:win:zip": "electron-builder build --win zip",
14+
"make:win:portable": "electron-builder build --win portable --x64 ",
1415
"make:mac:zip": "electron-builder build --mac zip",
1516
"make:mac:dmg": "electron-builder build --mac dmg",
1617
"make:linux:x64": "electron-builder build --linux --x64",
1718
"make:linux:x64:deb": "electron-builder build --linux deb --x64",
1819
"make:linux:x64:rpm": "electron-builder build --linux rpm --x64",
20+
"make:linux:x64:pac": "electron-builder build --linux pacman --x64",
1921
"make:linux:x64:appimage": "electron-builder build --linux appimage --x64",
2022
"make:linux:x64:zip": "electron-builder build --linux zip --x64",
2123
"make:linux:x64:tar": "electron-builder build --linux tar.xz --x64",
2224
"make:linux:arm": "electron-builder build --linux --arm64",
2325
"make:linux:arm:deb": "electron-builder build --linux deb --arm64",
2426
"make:linux:arm:rpm": "electron-builder build --linux rpm --arm64",
27+
"make:linux:arm:pac": "electron-builder build --linux pacman --arm64",
2528
"make:linux:arm:zip": "electron-builder build --linux zip --arm64",
2629
"make:linux:arm:tar.xz": "electron-builder build --linux tar.xz --arm64",
2730
"dist": "build"
@@ -97,6 +100,6 @@
97100
"nedb": "^1.8.0",
98101
"opml-to-json": "0.0.3",
99102
"vue": "^2.6.10",
100-
"ytdl-core": "^1.0.0"
103+
"ytdl-core": "^1.0.3"
101104
}
102105
}

src/js/player.js

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ function playVideo(videoId, playlistId = '') {
122122
playerView.validLive = false;
123123

124124
// Search through the returned object to get the 360p and 720p video URLs (If available)
125-
Object.keys(videoUrls).forEach((key) => {
126-
switch (videoUrls[key]['itag']) {
127-
case '18':
128-
playerView.video360p = decodeURIComponent(videoUrls[key]['url']);
125+
videoUrls.forEach((video) => {
126+
switch (video.itag) {
127+
case 18:
128+
playerView.video360p = decodeURIComponent(video.url);
129129
// ft.log(playerView.video360p);
130130
break;
131-
case '22':
132-
playerView.video720p = decodeURIComponent(videoUrls[key]['url']);
131+
case 22:
132+
playerView.video720p = decodeURIComponent(video.url);
133133
// ft.log(playerView.video720p);
134134
break;
135135
}
@@ -397,14 +397,14 @@ function playVideo(videoId, playlistId = '') {
397397
let formatUrls = data.adaptiveFormats;
398398

399399
// Search through the returned object to get the 360p and 720p video URLs (If available)
400-
Object.keys(videoUrls).forEach((key) => {
401-
switch (videoUrls[key]['itag']) {
402-
case '18':
403-
playerView.video360p = decodeURIComponent(videoUrls[key]['url']);
400+
videoUrls.forEach((video) => {
401+
switch (video.itag) {
402+
case 18:
403+
playerView.video360p = decodeURIComponent(video.url);
404404
// ft.log(playerView.video360p);
405405
break;
406-
case '22':
407-
playerView.video720p = decodeURIComponent(videoUrls[key]['url']);
406+
case 22:
407+
playerView.video720p = decodeURIComponent(video.url);
408408
// ft.log(playerView.video720p);
409409
break;
410410
}
@@ -1058,15 +1058,16 @@ function clickMiniPlayer(videoId) {
10581058

10591059
if (getVideosLocally) {
10601060
youtubedlGetInfo(videoId, (data) => {
1061-
let videoUrls = data.formats;
1061+
let videoUrls = data.formats
10621062

1063-
Object.keys(videoUrls).forEach((key) => {
1064-
switch (videoUrls[key]['itag']) {
1065-
case '18':
1066-
videoData.video360p = videoUrls[key]['url'];
1063+
// Search through the returned object to get the 360p and 720p video URLs (If available)
1064+
videoUrls.forEach((video) => {
1065+
switch (video.itag) {
1066+
case 18:
1067+
videoData.video360p = decodeURIComponent(video.url);
10671068
break;
1068-
case '22':
1069-
videoData.video720p = videoUrls[key]['url'];
1069+
case 22:
1070+
videoData.video720p = decodeURIComponent(video.url);
10701071
break;
10711072
}
10721073
});
@@ -1110,13 +1111,14 @@ function clickMiniPlayer(videoId) {
11101111
let videoUrls = data.formatStreams;
11111112
let formatUrls = data.adaptiveFormats;
11121113

1113-
Object.keys(videoUrls).forEach((key) => {
1114-
switch (videoUrls[key]['itag']) {
1115-
case '18':
1116-
videoData.video360p = videoUrls[key]['url'];
1114+
// Search through the returned object to get the 360p and 720p video URLs (If available)
1115+
videoUrls.forEach((video) => {
1116+
switch (video.itag) {
1117+
case 18:
1118+
videoData.video360p = decodeURIComponent(video.url);
11171119
break;
1118-
case '22':
1119-
videoData.video720p = videoUrls[key]['url'];
1120+
case 22:
1121+
videoData.video720p = decodeURIComponent(video.url);
11201122
break;
11211123
}
11221124
});

0 commit comments

Comments
 (0)