Skip to content

Commit

Permalink
workaround to fix #18. i wont call it a major overhaul bruh
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholascw committed Nov 3, 2023
1 parent 8a9b568 commit 71ace7f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backend/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,14 @@ void *fetch_b23tv(void *args_) {
return NULL;
}
int auto_redirect = args.info->is_bot;
if (strstr(args.url, "/api?full=") == args.url) {
if (strstr(args.url, "/api?") == args.url) {
char *full_url = strstr(args.url, "full=");
if (!full_url) full_url = args.url;
char *multi_args=strchr(args.url, '&');
if(strstr(args.url, "&status=200")) auto_redirect=200;
if(strstr(args.url, "status=200")) auto_redirect=200;
else auto_redirect = 1;
if(multi_args) *multi_args='\0';
char *decoded_url = urldecode(args.url);
char *decoded_url = urldecode(full_url);
if (decoded_url) {
char *hostname_in_full = strcasestr(decoded_url, "b23.tv/");
if (!hostname_in_full)
Expand Down

0 comments on commit 71ace7f

Please sign in to comment.