2019-07-03 3:28
(This post was last modified: 2019-07-15 22:11 by personaNonGrata.)
Hello guys,
I've created a little utility script for CamWhores.TV that let's you fetch all private videos links for given model.
Basically what it does is it goes through all pages of the "search results" for entered name and get's only links that are private.
The links list is split each 10 links to make copying easier to comply with the limit of ten links here.
The box is draggable and resizable.
Please note that this will freeze your tab but you can browse just fine in other tabs.
I've created a little utility script for CamWhores.TV that let's you fetch all private videos links for given model.
Basically what it does is it goes through all pages of the "search results" for entered name and get's only links that are private.
The links list is split each 10 links to make copying easier to comply with the limit of ten links here.
The box is draggable and resizable.
Please note that this will freeze your tab but you can browse just fine in other tabs.
Code:
// ==UserScript==
// @name CamWhoresTVLinkRipper
// @namespace camwhores_link_ripper
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://*.camwhores.tv/*
// @noframes
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
var container = '<div id="LinkContainer" class="links-container" style="position: absolute;top:30px; left: 30px; z-index: 9999;background-color: #626262;border: 1px solid #d3d3d3;"><div id="LinkContainerHeader" class="links-container--handle" style="padding:7px; background-color:#a4a4a4; cursor: pointer;">Private links from all pages</div><div style="padding-top: 20px;padding-left: 20px;padding-right: 20px;"><input type="text" id="WantedModelName" name="WantedModelName" placeholder="Enter model\'s name and press button" style="width:250px;"> </input><button class="triggerBtn" style="float:right; margin-left:10px;">GET LINKS</button></div><div class="links-container--list" style="display: block; padding: 20px; height: 150px; width: auto; overflow: hidden; resize:both"><textarea style="height:100%;width:100%;resize:none;"></textarea></div></div>';
$(container).appendTo('body');
dragElement(document.getElementById('LinkContainer'));
$('.triggerBtn').click(function() {
fetchPrivateVideosLinks($('#WantedModelName').val());
});
//var name = $('#search_form .search-text input').val();
function fetchPrivateVideosLinks(name) {
var error = false;
var count = 0;
var currentPage = 1;
$('#LinkContainer .links-container--list textarea').text('');
if (name != '') {
while (!error) {
$.ajax({
url: 'http://www.camwhores.tv/search/' + name + '/?mode=async&function=get_block&block_id=list_videos_videos_list_search_result&q=' + name + '&category_ids=&sort_by=post_date&from_videos=' + currentPage + '&from_albums=' + currentPage,
type: 'GET',
async: false,
success: function (data) {
currentPage++;
$(data).find('.list-videos .item.private a').each(function() {
//$('#LinkContainer .links-container--list textarea').append('<div>' + $(this).attr('href') + '</div>');
$('#LinkContainer .links-container--list textarea').append($(this).attr('href') + "\n");
count++;
if (count > 9) {
$('#LinkContainer .links-container--list textarea').append('\n');
// $('#LinkContainer .links-container--list').append('<div> </div>');
count = 0;
}
});
// TODO: Remove
if (currentPage > 200) {
console.log('setting error in success')
error = true;
}
},
error: function (xhr, textStatus, ex) {
console.log('setting error in error')
error = true;
}
})
}
};
};
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById("LinkContainerHeader")) {
// if present, the header is where you move the DIV from:
document.getElementById("LinkContainerHeader").onmousedown = dragMouseDown;
} else {
elmnt.onmousedown = dragMouseDown;
}
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
// get the mouse cursor position at startup:
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call a function whenever the cursor moves:
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
// calculate the new cursor position:
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
}
function closeDragElement() {
// stop moving when mouse button is released:
document.onmouseup = null;
document.onmousemove = null;
}
}
})();