mirror of https://github.com/FreeTubeApp/FreeTube
Fix: Revert back to Heroku calls for youtube-dl because of Windows
This commit is contained in:
parent
c624b7f02c
commit
1c471b5bad
|
@ -36,7 +36,7 @@
|
|||
},
|
||||
"electronPackagerConfig": {
|
||||
"packageManager": "yarn",
|
||||
"icon": "./src/icon.icns"
|
||||
"icon": "./src/icons/icon.icns"
|
||||
},
|
||||
"electronWinstallerConfig": {
|
||||
"name": "freetube",
|
||||
|
@ -65,7 +65,6 @@
|
|||
"jquery": "^3.3.1",
|
||||
"mustache": "^2.3.0",
|
||||
"nedb": "^1.8.0",
|
||||
"opml-to-json": "0.0.3",
|
||||
"youtube-dl": "^1.12.2"
|
||||
"opml-to-json": "0.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
*/
|
||||
function youtubeAPI(resource, params, success) {
|
||||
params.key = apiKey;
|
||||
console.log(resource, params, success)
|
||||
$.getJSON(
|
||||
'https://www.googleapis.com/youtube/v3/' + resource,
|
||||
params,
|
||||
|
@ -17,6 +16,8 @@ function youtubeAPI(resource, params, success) {
|
|||
).fail((xhr, textStatus, error) => {
|
||||
showToast('There was an error calling the YouTube API.');
|
||||
console.log(error);
|
||||
console.log(xhr);
|
||||
console.log(textStatus);
|
||||
stopLoadingAnimation();
|
||||
});
|
||||
}
|
||||
|
@ -30,10 +31,16 @@ function youtubeAPI(resource, params, success) {
|
|||
* @return {Void}
|
||||
*/
|
||||
function youtubedlGetInfo(videoId, callback) {
|
||||
let url = 'https://youtube.com/watch?v=' + videoId;
|
||||
let options = ['--all-subs', '--geo-bypass'];
|
||||
let url = 'https://stormy-inlet-41826.herokuapp.com/api/info?url=https://www.youtube.com/watch?v=' + videoId + 'flatten=True&writesubtitles=True&geo_bypass=True';
|
||||
$.getJSON(url, (response) => {
|
||||
callback(response.info);
|
||||
});
|
||||
|
||||
youtubedl.getInfo(url, options, {maxBuffer: Infinity}, function(err, info) {
|
||||
|
||||
/*let url = 'https://youtube.com/watch?v=' + videoId;
|
||||
let options = ['--all-subs'];
|
||||
|
||||
youtubedl.getInfo(url, options, function(err, info) {
|
||||
if (err){
|
||||
showToast('There was an issue calling youtube-dl.');
|
||||
stopLoadingAnimation();
|
||||
|
@ -43,5 +50,5 @@ function youtubedlGetInfo(videoId, callback) {
|
|||
|
||||
console.log('Success');
|
||||
callback(info);
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue