Skip to content

Commit

Permalink
Merge pull request #37 from CoordSpace/fix-categories
Browse files Browse the repository at this point in the history
Removed whitespace from categories concatenation.
  • Loading branch information
faissaloo authored Aug 11, 2021
2 parents 3077602 + 6da48c7 commit 5b9d552
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sponskrub/sponsorblock.d
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string stringify_timestamp(JSONValue raw_timestamp) {
}

ClipTime[] get_video_skip_times_direct(string video_id, Categories[] categories, string api_url, string proxy="") {
auto data = proxy_get("http://%s/api/skipSegments?videoID=%s&categories=%s".format(api_url, video_id, `["`~(cast(string[])categories).join(`", "`)~`"]`), proxy);
auto data = proxy_get("http://%s/api/skipSegments?videoID=%s&categories=%s".format(api_url, video_id, `["`~(cast(string[])categories).join(`","`)~`"]`), proxy);
auto json = parseJSON(data);
//This array needs sorting or whatever so they get lined up properly
//Or maybe we should get the thing that figures out the times to do that?
Expand All @@ -61,7 +61,7 @@ ClipTime[] get_video_skip_times_direct(string video_id, Categories[] categories,
}

ClipTime[] get_video_skip_times_private(string video_id, Categories[] categories, string api_url, string proxy="") {
auto data = proxy_get("http://%s/api/skipSegments/%s?categories=%s".format(api_url, sha256Of(video_id).toHexString!(LetterCase.lower)[0..uniform(3,32)], `["`~(cast(string[])categories).join(`", "`)~`"]`), proxy);
auto data = proxy_get("http://%s/api/skipSegments/%s?categories=%s".format(api_url, sha256Of(video_id).toHexString!(LetterCase.lower)[0..uniform(3,32)], `["`~(cast(string[])categories).join(`","`)~`"]`), proxy);
auto json = parseJSON(data);
foreach (JSONValue video; json.array) {
if (video["videoID"].str == video_id) {
Expand Down

0 comments on commit 5b9d552

Please sign in to comment.