aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-19 14:24:14 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-19 14:24:14 +0200
commitd137dcfa6dd248ffa94e58e7aef4487682bc12dc (patch)
tree94276cc45167d5e4499c4a9191395b38486b143a
parentca875b39ac35ac1499c303672f7217e2a7bbcab1 (diff)
youtube: fix description timestamp incorrectly including xx as a timestamp
-rw-r--r--src/NetUtils.cpp3
-rw-r--r--src/plugins/Youtube.cpp7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/NetUtils.cpp b/src/NetUtils.cpp
index 977bbbf..d6b6cf2 100644
--- a/src/NetUtils.cpp
+++ b/src/NetUtils.cpp
@@ -110,6 +110,9 @@ namespace QuickMedia {
} else {
i += 1;
}
+ } else if(c == '+') {
+ result += ' ';
+ i += 1;
} else {
result += c;
i += 1;
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 11ff7fa..2be4f8d 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -2064,8 +2064,6 @@ R"END(
return (hours * 60 * 60) + (minutes * 60) + seconds;
if(sscanf(timestamp, "%d:%d", &minutes, &seconds) == 2)
return (minutes * 60) + seconds;
- if(sscanf(timestamp, "%d", &seconds) == 1)
- return seconds;
return -1;
}
@@ -2147,10 +2145,8 @@ R"END(
const Json::Value &video_details_json = json_root["videoDetails"];
if(video_details_json.isObject()) {
const Json::Value &title_json = video_details_json["title"];
- if(title_json.isString()) {
+ if(title_json.isString())
title = title_json.asString();
- string_replace_all(title, '+', ' ');
- }
const Json::Value &channel_id_json = video_details_json["channelId"];
if(channel_id_json.isString())
@@ -2159,7 +2155,6 @@ R"END(
const Json::Value &description_json = video_details_json["shortDescription"];
if(description_json.isString()) {
std::string description = description_json.asString();
- string_replace_all(description, '+', ' ');
chapters = youtube_description_extract_chapters(description);
}
}