@robloxyoutube73/

sub to pewdiepie

Python

No description

fork
loading
Files
  • main.py
  • requirements.txt
main.py
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import requests
import xterm
import time

tSeriesId = 'UCq-Fj5jknLsUf-MWSy4_brA'
pewdiepieId = 'UC-lHJZR3Gqxm24_Vd_AJ5Yw'
xterm.goto(1,1)
xterm.print(f'{xterm.color("yellow","Pewdiepie")} and {xterm.color("red","T-Series")} live sub co unt',end='')

xterm.goto(3,3)
xterm.print('Current subs:\n  ============',end='')

xterm.goto(3,5)
xterm.print(xterm.color('yellow','Pewdiepie:'))
xterm.print(xterm.color('green','T-Series:'),x=4,end='')

xterm.goto(3,8)
xterm.print('Highest subs gained in one second:\n  =================================',end='')
xterm.goto(3,10)

xterm.print(xterm.color('yellow','Pewdiepie:'))
xterm.print(xterm.color('blue','T-Series:'),x=4,end='')

xterm.goto(3,13)
xterm.print('Highest subs lost in one second:\n  ===============================',end='')
xterm.goto(3,15)

xterm.print(xterm.color('yellow','Pewdiepie:'))
xterm.print(xterm.color('green','T-Series:'),x=4)

xterm.goto(3,18)
xterm.print('Distance apart:')

i = 0

pewmax = 0
tseriesmax = 0

pewmax2 = 0
tseriesmax2 = 0

pew2 = 0
tseries2 = 0

pew3 = 0
tseries3 = 0

timechecked = time.time()

pewgraph = []


while True:
	tseries = int(requests.get(f'https://youtube.mat1.repl.co/subscribers/{tSeriesId}').text)
	pew = int(requests.get(f'https://youtube.mat1.repl.co/subscribers/{pewdiepieId}').text)
	i+=1
	if i == 1:
		pew2=pew
		tseries2=tseries

		pew3=pew
		tseries3=tseries

	if time.time()-1>timechecked:
		timechecked = time.time()
		if pew-pew2>pewmax:
			pewmax=pew-pew2
		if tseries-tseries2>tseriesmax:
			tseriesmax=tseries-tseries2

		if pew2-pew>pewmax2:
			pewmax2=pew2-pew
		if tseries2-tseries>tseriesmax2:
			tseriesmax2=tseries2-tseries

		pew2,tseries2=pew,tseries
		
		
	pewdiff = pew-pew3
	tseriesdiff = tseries-tseries3
	if pewdiff==0:
		pewdiffstr=''
	else:
		pewdiffstr = f'{"+" if pewdiff >= 0 else ""}{pewdiff}'
	if tseriesdiff==0:
		tseriesdiffstr=''
	else:
		tseriesdiffstr = f'{"+" if tseriesdiff >= 0 else ""}{tseriesdiff}'

	pewstr = format(pew, ',d')
	tseriesstr = format(tseries, ',d')

	if pewdiff > 0:
		pewdiffstr = xterm.color('green',pewdiffstr)
	else:
		pewdiffstr = xterm.color('red',pewdiffstr)

	if tseriesdiff > 0:
		tseriesdiffstr = xterm.color('green',tseriesdiffstr)
	else:
		tseriesdiffstr = xterm.color('red',tseriesdiffstr)

	xterm.goto(14,5) # Current subs
	xterm.print(xterm.escape('K')+xterm.color('bold',pewstr),pewdiffstr)
	xterm.print(xterm.escape('K')+xterm.color('bold',tseriesstr),tseriesdiffstr,x=14,end='')

	if pew-pew3>pewmax:
		pewmax=pew-pew3
	if tseries-tseries3>tseriesmax:
		tseriesmax=tseries-tseries3
	pew3,tseries3=pew,tseries

	xterm.goto(14,10) # subs gained in a sec
	xterm.print(xterm.color('bold',pewmax))
	xterm.print(xterm.color('bold',tseriesmax),x=14,end='')

	xterm.goto(14,15) # subs lost in a sec
	xterm.print(xterm.color('bold',pewmax2))
	xterm.print(xterm.color('bold',tseriesmax2),x=14,end='')
	
	distance = format(pew-tseries, ',d')
	
	xterm.goto(19,18)
	xterm.print(xterm.escape('K')+xterm.color('bold',distance),end='')
	xterm.goto(1,20)

	time.sleep(0.2)