From dcadc536f3d279527e58f68d6a4b05e79436d06e Mon Sep 17 00:00:00 2001 From: msglm Date: Wed, 11 Jan 2023 20:51:08 -0600 Subject: Changed URL for API Ifunny changes its API url for its tag feeds. Instead of being https://ifunny.co/api/v1/feeds&tags=whatever it's now https://ifunny.co/api/v1/feeds/tags/whatever --- comedyGenerator | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comedyGenerator b/comedyGenerator index 2834126..763ea6f 100755 --- a/comedyGenerator +++ b/comedyGenerator @@ -10,6 +10,8 @@ import xdg import configparser import os +API_URL = "https://ifunny.co/api/v1/feeds/tags/" + class Video: def __init__(self, url, name): self.url = url @@ -175,7 +177,7 @@ for tags in args.tags: } for tries in range(100): try: - tagPage = requests.get("https://ifunny.co/api/v1/feeds?filter=" + contentFilter + "&tag=" + tags, headers=requestHeader, cookies=requestCookies) + tagPage = requests.get(API_URL + tags + "?filter=" + contentFilter, headers=requestHeader, cookies=requestCookies) if args.verbose: print("Got Webpage!") except: @@ -193,7 +195,7 @@ for tags in args.tags: videos.append( Video(JSONDump['items'][item]['url'], JSONDump['items'][item]['title']) ) for tries in range(100): try: - tagPage = requests.get("https://ifunny.co/api/v1/feeds?filter=" + contentFilter + "&tag=" + tags + "&next=" + JSONDump['pagination']['next'], headers=requestHeader, cookies=requestCookies) + tagPage = requests.get(API_URL + tags + "?filter=" + contentFilter + "&next=" + JSONDump['pagination']['next'], headers=requestHeader, cookies=requestCookies) JSONDump = tagPage.json() if args.verbose: print("Got New Tag Page!") -- cgit v1.2.3