-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlsgrab.py
More file actions
77 lines (52 loc) · 1.79 KB
/
lsgrab.py
File metadata and controls
77 lines (52 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /usr/bin python
# -*- coding: utf-8 -*-
from threading import Thread
import os
from strgen import StringGenerator
import requests
import urllib.request
from bs4 import BeautifulSoup
import colorama
from colorama import Fore, Style
colorama.init()
print(Fore.BLUE + '''
╦ ╔═╗
║ ╚═╗
╩═╝╚═╝
╔═╗┬─┐┌─┐┌┐ ┌┐ ┌─┐┬─┐
║ ╦├┬┘├─┤├┴┐├┴┐├┤ ├┬┘
╚═╝┴└─┴ ┴└─┘└─┘└─┘┴└
''')
print("...............coded by https://github.com/restanse")
print(Style.RESET_ALL)
count = input("enter count of threads: ")
count = int(count)
domlink = "https://prnt.sc/"
user_agents = { 'User-agent' : 'Mozilla / 5.0 (X11; Linux x86_64; rv: 70.0) Gecko / 20100101 Firefox / 70.0' }
check = os.path.exists("saved")
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
urllib.request.install_opener(opener)
if check == False:
os.mkdir("saved")
os.chdir("saved")
def parsing():
while True:
val = StringGenerator("[\d\w]{6}").render().lower()
url = domlink + val
r = requests.get(url,headers = user_agents)
if r.status_code == 200:
html = r.text
soup = BeautifulSoup(html, 'lxml')
try:
t = soup.find("img", crossorigin="anonymous", alt="Lightshot screenshot", id="screenshot-image")
link = t["src"]
except:
continue
name = link.split('/')[-1]
if link.split("/")[0] == "https:":
urllib.request.urlretrieve(link, name)
print(Fore.BLUE + "found: " + url + ". "+name+" saved to "+ os.getcwd())
for thrs in range(1, count):
thr = Thread(target = parsing)
thr.start()