summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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!")