summaryrefslogtreecommitdiffstats
path: root/stealIfunny
blob: aa57f3da517a092aca1059fba7d68df8ecec46dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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')