aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Youtube.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 34fd250..d308346 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -2321,7 +2321,7 @@ namespace QuickMedia {
}
}
- PluginResult YoutubeVideoPage::parse_video_response(const Json::Value &json_root, std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters) {
+ PluginResult YoutubeVideoPage::parse_video_response(const Json::Value &json_root, std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters, std::string &err_str) {
livestream_url.clear();
video_formats.clear();
audio_formats.clear();
@@ -2338,6 +2338,8 @@ namespace QuickMedia {
const Json::Value &status_json = playability_status_json["status"];
if(status_json.isString() && (strcmp(status_json.asCString(), "UNPLAYABLE") == 0 || strcmp(status_json.asCString(), "LOGIN_REQUIRED") == 0)) {
const Json::Value &reason_json = playability_status_json["reason"];
+ if(reason_json.isString())
+ err_str = reason_json.asString();
fprintf(stderr, "Unable to play video, status: %s, reason: %s\n", status_json.asCString(), reason_json.isString() ? reason_json.asCString() : "Unknown");
return PluginResult::ERR;
}
@@ -2432,7 +2434,7 @@ namespace QuickMedia {
return PluginResult::OK;
}
- PluginResult YoutubeVideoPage::load(std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters) {
+ PluginResult YoutubeVideoPage::load(std::string &title, std::string &channel_url, std::vector<MediaChapter> &chapters, std::string &err_str) {
livestream_url.clear();
video_formats.clear();
audio_formats.clear();
@@ -2479,7 +2481,7 @@ R"END(
DownloadResult download_result = download_json(json_root, "https://www.youtube.com/youtubei/v1/player?key=" + api_key + "&gl=US&hl=en", additional_args, true);
if(download_result != DownloadResult::OK) return download_result_to_plugin_result(download_result);
- return parse_video_response(json_root, title, channel_url, chapters);
+ return parse_video_response(json_root, title, channel_url, chapters, err_str);
}
void YoutubeVideoPage::mark_watched() {