forked from pusspounder/CapMyFreeCamsChaturbateNodeJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
296 lines (256 loc) · 11.4 KB
/
index.html
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!doctype html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>MyFreeCams Recorder</title>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,300' type='text/css'>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-red.min.css" />
<style>
a[disabled] {
pointer-events: none;
}
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
body {
background-color: #efefef;
}
main.mdl-layout__content {
overflow-x: auto;
}
.padding {
display: table-cell;
width: 50%;
}
.table{
padding: 40px 0px 150px;
display: table-cell;
}
a[ng-click],
th[ng-click] {
cursor: pointer;
}
.material-icons.mdi-24 {
font-size: 24px;
}
.spinner {
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
background: #efefef;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
.refresh {
position: relative;
top: 30px;
}
.ko-fi {
display: none;
}
@media (min-width: 768px) {
.ko-fi {
margin-right: 15px;
display: block;
}
}
</style>
</head>
<body ng-controller="AppController as vm">
<div class="spinner" ng-hide="vm.ready">
<div class="mdl-spinner mdl-js-spinner is-active"></div>
</div>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">MyFreeCams Recorder</span>
<div class="mdl-layout-spacer"></div>
<a class="ko-fi" href='https://ko-fi.com/A320FTJ' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
<nav class="mdl-navigation">
<button class="refresh mdl-button mdl-js-button mdl-button--fab mdl-button--colored mdl-shadow--4dp" ng-click="vm.refresh()" title="reload">
<i class="material-icons">refresh</i>
</button>
</nav>
</div>
</header>
<main class="mdl-layout__content">
<!-- <div class="mdl-grid">
<div class="mdl-cell mdl-cell--12-col" style="overflow: auto"> -->
<div class="padding"></div>
<div class="table">
<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('nm')" ng-class="vm.sortType == 'nm' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Name</th>
<th ng-click="vm.sort('u.age')" ng-class="vm.sortType == 'u.age' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Age</th>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('vs')" ng-class="vm.sortType == 'vs' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">State</th>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('u.city')" ng-class="vm.sortType == 'u.city' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">City</th>
<th ng-click="vm.sort('m.camscore')" ng-class="vm.sortType == 'm.camscore' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Score</th>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('u.country')" ng-class="vm.sortType == 'u.country' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Country</th>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('m.missmfc')" ng-class="vm.sortType == 'm.missmfc' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Miss MFC</th>
<th class="mdl-data-table__cell--non-numeric" ng-click="vm.sort('m.new_model')" ng-class="vm.sortType == 'm.new_model' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">New</th>
<th ng-click="vm.sort('m.rc')" ng-class="vm.sortType == 'm.rc' ? ('mdl-data-table__header--sorted-' + (vm.sortReverse ? 'ascending' : 'descending') ) : ''">Viewers</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="model in vm.models | orderBy:vm.sortType:vm.sortReverse" ng-class="vm.rowColor(model.vs)">
<td class="mdl-data-table__cell--non-numeric">
<a class="mdl-color-text--blue-800" ng-click="vm.preview(model)" ng-bind="model.nm"></a>
</td>
<td ng-bind="model.u.age"></td>
<td class="mdl-data-table__cell--non-numeric" ng-bind="model.state"></td>
<td class="mdl-data-table__cell--non-numeric" ng-bind="model.u.city"></td>
<td ng-bind="model.m.camscore"></td>
<td class="mdl-data-table__cell--non-numeric" ng-bind="model.u.country"></td>
<td class="mdl-data-table__cell--non-numeric"><i class="material-icons mdi-24 mdl-color-text--amber-500" ng-bind="model.m.missmfc"></i></td>
<td class="mdl-data-table__cell--non-numeric"><i class="material-icons mdi-24 mdl-color-text--orange-500" ng-bind="model.m.new_model"></i></td>
<td ng-bind="model.m.rc"></td>
<td>
<button id="{{ 'action-list-' + model.uid }}" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">more_vert</i>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu" for="{{ 'action-list-' + model.uid }}">
<li class="mdl-menu__item" ng-click="vm.includeUid(model)" ng-disabled="vm.includeDisabled(model)">Include</li>
<li class="mdl-menu__item mdl-menu__item--full-bleed-divider" ng-click="vm.excludeUid(model)" ng-disabled="vm.excludeDisabled(model)">Exclude</li>
<li class="mdl-menu__item" ng-click="vm.deleteUid(model)" ng-disabled="model.nextMode == -1">Delete</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="padding"></div>
<!-- </div>
</div> -->
</main>
</div>
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
<script src="https://code.angularjs.org/1.5.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script>
var getState = function(vs) {
var state = {
'vs-4': 'Capturing',
'vs-3': 'To Include',
'vs-2': 'To Exclude',
'vs-1': 'To Delete',
'vs0': 'Online',
'vs2': 'Away',
'vs12': 'In Private',
'vs13': 'In Group Show',
'vs90': 'Online',
'vs91': 'In Private',
'vs127': 'Offline',
'vs1000': 'Recording',
'vs1001': 'To Iclude',
'vs1002': 'To Exclude'
};
return state['vs' + vs] || 'Unknown';
};
var app = angular.module('app', []);
app.controller('AppController', ['$timeout', '$http', function($timeout, $http) {
var vm = this;
vm.models = [];
vm.sortType = 'nm';
vm.sortReverse = false;
vm.sort = function(sortType) {
if (vm.sortType == sortType) {
vm.sortReverse = !vm.sortReverse;
} else {
vm.sortType = sortType;
}
};
vm.includeUid = function(model) {
$http.get('/models/include', {params: {uid: model.uid}}).then(function(response) {
model.nextMode = 1;
model.vs = -3;
model.state = getState(model.vs);
});
};
vm.excludeUid = function(model) {
$http.get('/models/exclude', {params: {uid: model.uid}}).then(function(response) {
model.nextMode = 0;
model.vs = -2;
model.state = getState(model.vs);
});
};
vm.deleteUid = function(model) {
$http.get('/models/delete', {params: {uid: model.uid}}).then(function(response) {
model.nextMode = -1;
model.vs = -1;
model.state = getState(model.vs);
});
};
vm.includeDisabled = function(model) {
return model.nextMode == 1 || (model.mode == 1 && model.nextMode == undefined);
};
vm.excludeDisabled = function(model) {
return model.nextMode == 0 || (model.mode == 0 && model.nextMode == undefined);
};
vm.preview = function(model) {
console.log('http://video' + (model.u.camserv - 500) + '.myfreecams.com:1935/NxServer/ngrp:mfc_' + (100000000 + model.uid) + '.f4v_mobile/playlist.m3u8?nc=1423603882490');
var url = 'https://www.myfreecams.com/#' + model.nm;
window.open(url, '_blank');
};
vm.rowColor = function(vs) {
if (vs == -4) {
return 'mdl-color-text--green-400 mdl-color--green-50';
} else if (vs == -3) {
return 'mdl-color-text--blue-300 mdl-color--blue-50';
} else if (vs == -1) {
return 'mdl-color-text--red-300 mdl-color--red-50';
} else if (vs == -2 || vs > 0) {
return 'mdl-color-text--grey-400 mdl-color--grey-100';
}
};
vm.refresh = function() {
vm.ready = false;
$http
.get('/models')
.then(function(response) {
vm.models = _
.reject(response.data, function(m) {
return m.mode < 0; // remove deleted models
})
.map(function(m) {
if (!m.mode) {
m.mode = 0; // set "default" mode for models without mode
}
// set our own virtual value for vs field
if (m.nextMode === 1) {
m.vs = -3; // to include
} else if (m.nextMode === 0) {
m.vs = -2; // to exclude
} else if (m.nextMode === -1) {
m.vs = -1; // to delete
} else if (m.capturing == true) {
m.vs = -4; // capturing
}
// get text description of the state
m.state = getState(m.vs);
if (m.u.city && m.u.city.length > 20) {
m.u.city = m.u.city.substr(0, 19) + '…';
}
if (m.u.country && m.u.country.length > 20) {
m.u.country = m.u.country.substr(0, 19) + '…';
}
m.m.missmfc = m.m.missmfc ? 'star' : '';
m.m.new_model = m.m.new_model ? 'new_releases' : '';
return m;
});
$timeout(function() {
componentHandler.upgradeAllRegistered();
vm.ready = true;
});
});
};
vm.refresh();
}]);
</script>
</body>
</html>