forked from horacio9a/chaturbate-anonymous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cbffr.py
117 lines (96 loc) · 3.4 KB
/
cbffr.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
# Chaturbate FFMPEG Remote Anonymous Freechat Recorder v.1.1.1 by horacio9a for Python 2.7.16
# coding: utf-8
import sys, os, urllib, urllib3, ssl, re, time, datetime, requests, random, command
urllib3.disable_warnings()
from urllib3 import PoolManager
reload(sys)
sys.setdefaultencoding('utf-8')
from colorama import init, Fore, Back, Style
from termcolor import colored
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('config.ini')
init()
print
print(colored(' => START <=', 'yellow', 'on_blue'))
print
if __name__=='__main__':
import sys
model = sys.argv[1]
url ='https://chaturbate.com/{}/'.format(model)
manager = PoolManager(10)
r = manager.request('GET', url)
enc = (r.data)
dec=urllib.unquote(enc)
if 'HTTP 404' not in dec:
try:
pwd0 = dec.split('broadcaster_username')[1]
pwd = pwd0.split(':')[0]
except:
print(colored(' => Wrong model name or banned <=', 'yellow','on_red'))
print
print(colored(' => END <=', 'yellow','on_blue'))
sys.exit()
if 'u0022offline' not in dec:
hlsurl0 = dec.split('u0022https:')[1]
hlsurl1 = hlsurl0.split('\u0022,')[0]
if len(hlsurl1) > 180:
print(colored(' => Try again <=', 'yellow','on_blue'))
sys.exit()
else:
pass
if len(hlsurl1) > 50:
hlsurl2 = re.sub('//', 'https://', hlsurl1)
server1 = hlsurl2.split('\u002Dhls')[0]
server = re.sub('live', 'live-hls/', server1)
try:
rp = hlsurl2.split('sd\u002D')[1]
except:
rp = hlsurl2.split('ws\u002D')[1]
hlsurl = ('{}amlst:{}-sd-{}'.format(server,model,rp))
try:
rn0 = dec.split('Real Name:</div>\n <div class="data">')[1]
rn = rn0.split('</div>')[0]
except:
rn = '-'
try:
loc0 = dec.split('Location:</div>\n <div class="data">')[1]
loc = loc0.split('</div>')[0]
except:
loc = '-'
try:
age0 = dec.split('Age:</div>\n <div class="data">')[1]
age = age0.split('</div>')[0]
except:
age = '-'
bg0 = dec.split('gender\u0022: \u0022')[1]
bg = bg0.split('\u0022')[0]
print ((colored(' => INFO => Real Name: ({}) * Location: ({}) * Age: ({}) * Gender: ({}) <=', 'yellow', 'on_blue')).format(rn,loc,age,bg))
timestamp = str(time.strftime('%d%m%Y-%H%M%S'))
path = config.get('folders', 'output_folder')
filename = model + '_CB_' + timestamp + '.flv'
pf = (path + filename)
ffmpeg = config.get('files', 'ffmpeg')
print
print((colored(' => FF-FLV-REC => {} <=', 'yellow', 'on_red')).format(filename))
print
command = '{} -hide_banner -loglevel panic -i {} -c:v copy -c:a aac -b:a 128k {}'.format(ffmpeg,hlsurl,pf)
os.system(command)
print
print(colored(' => END <= ', 'yellow','on_blue'))
sys.exit()
else:
print(colored(' => Model is PVT/HIDDEN or AWAY <=', 'yellow','on_red'))
print
print(colored(' => END <=', 'yellow','on_blue'))
sys.exit()
else:
print(colored(' => Model is OFFLINE <=', 'yellow','on_red'))
print
print(colored(' => END <=', 'yellow','on_blue'))
sys.exit()
else:
print(colored(' => Page Not Found <=', 'yellow','on_red'))
print
print(colored(' => END <=', 'yellow','on_blue'))
sys.exit()