├── README.md ├── img └── ruby.png ├── requirements.txt ├── ruby.py └── scripts ├── __pycache__ ├── bitchute.cpython-39.pyc ├── rumble.cpython-39.pyc └── youtube.cpython-39.pyc ├── bitchute.py ├── rumble.py └── youtube.py /README.md: -------------------------------------------------------------------------------- 1 | # Ruby 2 | A **Ru**mble, **B**itChute, and **Y**ouTube scraper 3 | 4 | ![Alt text](./img/ruby.png) 5 | 6 | ## How to use 7 | 8 | ``` 9 | python3 ruby.py 10 | ``` 11 | 12 | ## Output 13 | 14 | Find search.csv for the stored search results 15 | 16 | -------------------------------------------------------------------------------- /img/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecreps/ruby/1f1a0ba8d9ced7c0e59a20220fec6f48cf84953c/img/ruby.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | colorama 3 | sys 4 | csv 5 | os.path 6 | argparse 7 | -------------------------------------------------------------------------------- /ruby.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import sys 4 | import argparse 5 | from colorama import Fore, Back, Style, init 6 | import csv 7 | import os.path 8 | from scripts.bitchute import * 9 | from scripts.rumble import * 10 | from scripts.youtube import * 11 | import time 12 | 13 | init(autoreset=True) 14 | 15 | ruby = Fore.RED + r""" 16 | ▄████████ ███ █▄ ▀█████████▄ ▄██ ▄ 17 | ███ ███ ███ ███ ███ ███ ███ ██▄ 18 | ███ ███ ███ ███ ███ ███ ███▄▄▄███ 19 | ▄███▄▄▄▄██▀ ███ ███ ▄███▄▄▄██▀ ▀▀▀▀▀▀███ 20 | ▀▀███▀▀▀▀▀ ███ ███ ▀▀███▀▀▀██▄ ▄██ ███ 21 | ▀███████████ ███ ███ ███ ██▄ ███ ███ 22 | ███ ███ ███ ███ ███ ███ ███ ███ 23 | ███ ███ ████████▀ ▄█████████▀ ▀█████▀ 24 | ███ ███ 25 | """ 26 | 27 | print(ruby) 28 | print(" A Rumble, Bitchute, and YouTube scraper and search engine \n") 29 | print(Fore.RED + " Ruby is searching... \n") 30 | time.sleep(2) 31 | 32 | print(Fore.RED + " [!] -- Rumble results -- [!] \n") 33 | rumble() 34 | print(Fore.RED + " [!] -- BitChute results -- [!] \n") 35 | bitchute() 36 | print(Fore.RED + " [!] -- YouTube results -- [!] \n") 37 | youtube() 38 | 39 | with open('search.csv',"r") as f: 40 | reader = csv.reader(f,delimiter = ",") 41 | data = list(reader) 42 | row_count = len(data) 43 | 44 | print(Fore.RED + " [!] -- Search complete. Check search.csv -- [!]\n") 45 | 46 | print(Fore.RED + " [#] -- Ruby has collected " + str(row_count) + " total videos -- [#]\n") 47 | -------------------------------------------------------------------------------- /scripts/__pycache__/bitchute.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecreps/ruby/1f1a0ba8d9ced7c0e59a20220fec6f48cf84953c/scripts/__pycache__/bitchute.cpython-39.pyc -------------------------------------------------------------------------------- /scripts/__pycache__/rumble.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecreps/ruby/1f1a0ba8d9ced7c0e59a20220fec6f48cf84953c/scripts/__pycache__/rumble.cpython-39.pyc -------------------------------------------------------------------------------- /scripts/__pycache__/youtube.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakecreps/ruby/1f1a0ba8d9ced7c0e59a20220fec6f48cf84953c/scripts/__pycache__/youtube.cpython-39.pyc -------------------------------------------------------------------------------- /scripts/bitchute.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import sys 4 | import argparse 5 | import csv 6 | import os.path 7 | 8 | def bitchute(): 9 | file_exists = os.path.exists('search.csv') 10 | 11 | if file_exists: 12 | header_added = True 13 | else: 14 | header_added = False 15 | 16 | smat_query = str(sys.argv[1:]) 17 | 18 | limit = "50" #change this variable to get more or less results 19 | 20 | smat_url = "https://api.smat-app.com/content?term=" + smat_query + "&limit=" + limit + "&site=bitchute_video&since=2022-03-22T19%3A12%3A30.802480&until=2022-05-22T19%3A12%3A30.802480&esquery=false&sortdesc=false" 21 | 22 | smat_response = requests.get(smat_url) 23 | 24 | smat_json_data = smat_response.json() 25 | 26 | hits = smat_json_data["hits"]["hits"] 27 | 28 | for videos in hits: 29 | try: 30 | usernames = videos["_source"]["meta"]["channel_id"] 31 | print(" Username: " + usernames) 32 | authors = videos["_source"]["channel"] 33 | print(" Author: " + authors) 34 | titles = videos["_source"]["title"] 35 | print(" Title: " + titles) 36 | urls = videos["_source"]["canonical"] 37 | print(" URL: " + urls + "\n") 38 | except: 39 | pass 40 | 41 | try: 42 | with open('search.csv', 'a') as csvfile: 43 | fieldnames = ['author', 'usernames', 'title', 'author_url', 'url'] 44 | writer = csv.DictWriter(csvfile, fieldnames=fieldnames) 45 | if not header_added: 46 | writer.writeheader() 47 | header_added = True 48 | writer.writerow({'author': authors, 'usernames': usernames, 'title': titles, 'author_url': '', 'url': urls}) 49 | except: 50 | pass 51 | -------------------------------------------------------------------------------- /scripts/rumble.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import sys 4 | import argparse 5 | import csv 6 | import os.path 7 | 8 | def rumble(): 9 | file_exists = os.path.exists('search.csv') 10 | 11 | if file_exists: 12 | header_added = True 13 | else: 14 | header_added = False 15 | 16 | rumble_query = str(sys.argv[1:]) 17 | 18 | limit = "50" #change this variable to get more or less results 19 | 20 | rumble_url = "https://api.smat-app.com/content?term=" + rumble_query + "&limit=" + limit + "&site=rumble_video&since=2022-03-22T19%3A12%3A30.802480&until=2022-05-22T19%3A12%3A30.802480&esquery=false&sortdesc=false" 21 | 22 | rumble_response = requests.get(rumble_url) 23 | 24 | rumble_json_data = rumble_response.json() 25 | 26 | hits = rumble_json_data["hits"]["hits"] 27 | 28 | for videos in hits: 29 | try: 30 | usernames = videos["_source"]["channel_id"] 31 | print(" Username: " + usernames) 32 | authors = videos["_source"]["username"] 33 | print(" Author: " + authors) 34 | titles = videos["_source"]["metadata"]["name"] 35 | print(" Title: " + titles) 36 | urls = videos["_source"]["canonical"] 37 | print(" URL: " + urls + "\n") 38 | except: 39 | pass 40 | 41 | try: 42 | with open('search.csv', 'a') as csvfile: 43 | fieldnames = ['author', 'usernames', 'title', 'author_url', 'url'] 44 | writer = csv.DictWriter(csvfile, fieldnames=fieldnames) 45 | if not header_added: 46 | writer.writeheader() 47 | header_added = True 48 | writer.writerow({'author': authors, 'usernames': usernames, 'title': titles, 'author_url': '', 'url': urls}) 49 | except: 50 | pass 51 | -------------------------------------------------------------------------------- /scripts/youtube.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import sys 4 | import argparse 5 | import csv 6 | import os.path 7 | 8 | def youtube(): 9 | file_exists = os.path.exists('search.csv') 10 | 11 | if file_exists: 12 | header_added = True 13 | else: 14 | header_added = False 15 | 16 | query = str(sys.argv[1:]) 17 | 18 | url = "http://youtube-scrape.herokuapp.com/api/search?q=" + query + "&page=1" 19 | 20 | response = requests.get(url) 21 | 22 | data = response.json() 23 | 24 | data = data["results"] 25 | 26 | for videos in data: 27 | try: 28 | authors = videos["uploader"]["username"] 29 | print(" Author: " + authors) 30 | titles = videos["video"]["title"] 31 | print(" Title: " + titles) 32 | urls = videos["video"]["url"] 33 | print(" URL: " + urls) 34 | author_urls = videos["uploader"]["url"] 35 | print(" Author URL: " + author_urls + "\n") 36 | except: 37 | pass 38 | 39 | with open('search.csv', 'a') as csvfile: 40 | fieldnames = ['author', 'usernames', 'title', 'author_url', 'url'] 41 | writer = csv.DictWriter(csvfile, fieldnames=fieldnames) 42 | if not header_added: 43 | writer.writeheader() 44 | header_added = True 45 | writer.writerow({'author': authors, 'usernames': '', 'title': titles, 'author_url': author_urls, 'url': urls}) 46 | --------------------------------------------------------------------------------