aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-06-19 00:15:20 +0200
committerdec05eba <dec05eba@protonmail.com>2022-06-19 00:15:20 +0200
commit42891df4c3c184b7123ba44693c489f489de10e3 (patch)
tree121256b497cb6468c8fa2f070baaf240a7af9949
parentad2685624cf233456623c5fa34083412df53873c (diff)
Youtube: ignore broken itag 22 until youtube fixes it
-rw-r--r--src/QuickMedia.cpp2
-rw-r--r--src/plugins/Fourchan.cpp1
-rw-r--r--src/plugins/Youtube.cpp3
-rw-r--r--video_player/src/main.cpp10
4 files changed, 11 insertions, 5 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 3789cc1..dad215f 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3691,6 +3691,8 @@ namespace QuickMedia {
double file_duration = 0.0;
video_player->get_duration_in_file(&file_duration);
video_duration = std::max(video_duration, file_duration);
+ if(video_duration > 0.001)
+ successfully_fetched_video_duration = true;
}
}
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index c11e13e..051acc3 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -442,6 +442,7 @@ namespace QuickMedia {
author_str = author.asString();
author_str += " #" + std::to_string(post_num.asInt64());
+ html_unescape_sequences(author_str);
std::string comment_text = html_to_text(sub_begin, sub_end - sub_begin, comment_by_postno, result_items, body_item_index);
if(!comment_text.empty())
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 7722f5d..1b46ed6 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -2614,6 +2614,9 @@ R"END(
YoutubeFormat youtube_format_base;
+ const Json::Value &itag_json = format["itag"];
+ if(!itag_json.isInt() || itag_json.asInt() == 22) continue; // TODO: itag 22 video format is broken right now server-side for some reason
+
const Json::Value &mime_type_json = format["mimeType"];
if(!mime_type_json.isString()) continue;
youtube_format_base.mime_type = mime_type_json.asString();
diff --git a/video_player/src/main.cpp b/video_player/src/main.cpp
index 2c6dba4..c80cf9a 100644
--- a/video_player/src/main.cpp
+++ b/video_player/src/main.cpp
@@ -43,7 +43,7 @@ static Json::Value handle_json_command_time_pos(mpv_handle *mpv_ctx) {
Json::Value response_json(Json::objectValue);
if(res < 0) {
response_json["status"] = "error";
- response_json["message"] = mpv_error_string(res);
+ response_json["message"] = std::string("time-pos: ") + mpv_error_string(res);
} else {
response_json["status"] = "success";
response_json["data"] = time_pos;
@@ -58,7 +58,7 @@ static Json::Value handle_json_command_duration(mpv_handle *mpv_ctx) {
Json::Value response_json(Json::objectValue);
if(res < 0) {
response_json["status"] = "error";
- response_json["message"] = mpv_error_string(res);
+ response_json["message"] = std::string("duration: ") + mpv_error_string(res);
} else {
response_json["status"] = "success";
response_json["data"] = duration;
@@ -114,7 +114,7 @@ static Json::Value handle_json_command_sub_add(mpv_handle *mpv_ctx, const Json::
const int res = mpv_command_async(mpv_ctx, 0, args.data());
if(res < 0) {
response_json["status"] = "error";
- response_json["message"] = mpv_error_string(res);
+ response_json["message"] = std::string("sub-add: ") + mpv_error_string(res);
} else {
response_json["status"] = "success";
}
@@ -128,7 +128,7 @@ static Json::Value handle_json_command_cycle_fullscreen(mpv_handle *mpv_ctx) {
Json::Value response_json(Json::objectValue);
if(res < 0) {
response_json["status"] = "error";
- response_json["message"] = mpv_error_string(res);
+ response_json["message"] = std::string("cycle fullscreen: ") + mpv_error_string(res);
} else {
response_json["status"] = "success";
}
@@ -644,7 +644,7 @@ int main(int argc, char **argv) {
break;
} else if(event->event_id == MPV_EVENT_END_FILE) {
mpv_event_end_file *end_file_event = (mpv_event_end_file*)event->data;
- if(end_file_event->error == MPV_END_FILE_REASON_ERROR) {
+ if(end_file_event->reason == MPV_END_FILE_REASON_ERROR) {
exit_code = 2;
break;
}