File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import argparse
22import threading
33from datetime import datetime
4+ from json import decoder
45from os import path , mkdir
56
67import requests
@@ -26,7 +27,13 @@ def main():
2627 fetch_limit = 100
2728
2829 current_request = requests .get ("https://scrape.pastebin.com/api_scraping.php?limit={0}" .format (fetch_limit ))
29- current_json = current_request .json ()
30+ try :
31+ current_json = current_request .json ()
32+
33+ except decoder .JSONDecodeError :
34+ status ("Unable to fetch latest pastes. Make sure your IP is whitelisted at "
35+ "https://pastebin.com/doc_scraping_api" )
36+ exit (0 )
3037
3138 status ("Pastes fetched. Processing..." )
3239 skipped_pastes = 0
@@ -90,7 +97,7 @@ def main():
9097
9198 AUTHOR = "SYRAPT0R"
9299 COPYRIGHT = "2019"
93- VERSION = "0.3.1 "
100+ VERSION = "0.3.2 "
94101
95102 status ("STARTING PASTA SCRAPER {0}, (c) {1} {2}" .format (VERSION , COPYRIGHT , AUTHOR ))
96103 print ()
You can’t perform that action at this time.
0 commit comments