summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <test>2021-08-16 22:28:28 -0500
committerYour Name <test>2021-08-16 22:28:28 -0500
commit2db2c6857c1d8d6537b0c8862bedcf14c2ef4621 (patch)
tree5a2dd9a740191584886b68eca67884e0fbee2885
downloadcomedyGenerator-2db2c6857c1d8d6537b0c8862bedcf14c2ef4621.tar.gz
comedyGenerator-2db2c6857c1d8d6537b0c8862bedcf14c2ef4621.tar.bz2
comedyGenerator-2db2c6857c1d8d6537b0c8862bedcf14c2ef4621.zip
script uses basic parsing to download what is needed
-rwxr-xr-xstealIfunny18
1 files changed, 18 insertions, 0 deletions
diff --git a/stealIfunny b/stealIfunny
new file mode 100755
index 0000000..aa57f3d
--- /dev/null
+++ b/stealIfunny
@@ -0,0 +1,18 @@
+#!/usr/bin/python3
+from bs4 import BeautifulSoup
+import requests
+import urllib.request
+import sys
+import os
+if len(sys.argv) == 1:
+ print("List tags at the end you'd like to download")
+for tags in sys.argv:
+ URL = requests.get('https://ifunny.co/tags/' + tags + '?filter=video')
+ webpage = BeautifulSoup(URL.content, 'html.parser')
+
+ epoch = len([item for item in os.listdir('/home/joybuke/Media/Videos/unsorted/')])
+ videos = webpage.findAll('video')
+ for video in videos:
+ epoch = epoch + 1
+ print(video['data-src'])
+ urllib.request.urlretrieve(video['data-src'], '/home/joybuke/Media/Videos/unsorted/' + str(epoch) + '.mp4')