summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-01-11 20:51:08 -0600
committermsglm <msglm@techchud.xyz>2023-01-11 20:51:08 -0600
commitdcadc536f3d279527e58f68d6a4b05e79436d06e (patch)
tree8a203ba8bcc2cf0af2103d0056a8d35a877561af
parent4c61aeff0369b8bb74fae5eecb1101aa5ae02df3 (diff)
downloadcomedyGenerator-dcadc536f3d279527e58f68d6a4b05e79436d06e.tar.gz
comedyGenerator-dcadc536f3d279527e58f68d6a4b05e79436d06e.tar.bz2
comedyGenerator-dcadc536f3d279527e58f68d6a4b05e79436d06e.zip
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
-rwxr-xr-xcomedyGenerator6
1 files 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!")