PageSourceSearch

https://4tube.asia/ftube-clone.js?v=20261005-1

js 4tube.asia collected 2026-10-06 17:52:36 UTC 7,028 bytes, 4 lines download raw bytes

1(function(){'use strict';function ready(fn){if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',fn,{once:true});else fn()}function languageMenu(){var existing=document.querySelector('.jm-language');if(existing)return existing;var nav=document.querySelector('#menu-main-menu');if(!nav)return null;var languages=[['en','English'],['cn','Chinese'],['cz','Czech'],['dk','Danish'],['nl','Dutch'],['ee','Estonian'],['fi','Finnish'],['fr','French'],['de','German'],['gr','Greek'],['it','Italian'],['jp','Japanese'],['kr','Korean'],['no','Norwegian'],['pl','Polish'],['pt','Portuguese'],['ru','Russian'],['es','Spanish'],['se','Swedish']],first=location.pathname.split('/').filter(Boolean)[0]||'en',current=languages.some(function(x){return x[0]===first})?first:'en',li=document.createElement('li');li.className='jm-language';var label='English';languages.forEach(function(item){if(item[0]===current)label=item[1]});li.innerHTML='<button type="button" class="jm-language__toggle" aria-expanded="false"></button><ul class="jm-language__list"></ul>';li.querySelector('button').textContent=label+' ▾';var list=li.querySelector('ul');
1languages.forEach(function(item){var row=document.createElement('li'),a=document.createElement('a');var local=location.pathname.replace(/^\/(?:cn|cz|dk|nl|ee|fi|fr|de|gr|it|jp|kr|no|pl|pt|ru|es|se)(?=\/|$)/,'')||'/';a.href=(item[0]==='en'?'':'/'+item[0])+(local==='/'?'/':local)+location.search;a.target='_self';a.hreflang=item[0];a.textContent=item[1];if(item[0]===current)a.className='is-active';row.appendChild(a);list.appendChild(row)});nav.appendChild(li);return li}ready(function(){if(/^\/videos\/\d+-[^/]+\.html$/.test(location.pathname)&&/^\?\d+x\d+x\d+$/.test(location.search)&&history.replaceState){history.replaceState(null,document.title,location.pathname+location.hash)}document.querySelectorAll('a[href^="/xxx-cat/"]').forEach(function(a){var parts=a.getAttribute('href').split('/');if(parts[2]){try{parts[2]=decodeURIComponent(parts[2])}catch(e){}parts[2]=parts[2].toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'');a.setAttribute('href',parts.join('/'))}});var menu=document.querySelector('.navbar-toggler'),nav=document.querySelector('#navbarNavDropdown');if(menu&&nav)menu.addEventListener('click',function(){var open=nav.classList.toggle('show');menu.setAttribute('aria-expanded',open?'true':'false')});var search=document.querySelector('.header-search-mobile'),box=document.querySelector('.header-search');if(search&&box)search.addEventListener('click',function(){box.classList.toggle('is-open');var input=box.querySelector('input');if(box.classList.contains('is-open')&&input)input.focus()});var lang=languageMenu(),toggle=lang&&lang.querySelector('.jm-language__toggle');if(toggle)toggle.addEventListener('click',function(e){e.preventDefault();lang.classList.toggle('is-open');toggle.setAttribute('aria-expanded',lang.classList.contains('is-open')?'true':'false')});document.addEventListener('click',function(e){if(lang&&!lang.contains(e.target))lang.classList.remove('is-open')})})}());
2(function(){'use strict';var key='ftube_favorites_v1';function read(){try{return JSON.parse(localStorage.getItem(key)||'[]').map(String)}catch(e){return[]}}function write(ids){try{localStorage.setItem(key,JSON.stringify(ids))}catch(e){}}function ready(fn){if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',fn,{once:true});else fn()}ready(function(){var ids=read(),button=document.querySelector('.jm-favorite-button[data-favorite-id]');if(button){var id=String(button.dataset.favoriteId),paint=function(){var active=ids.indexOf(id)!==-1;button.setAttribute('aria-pressed',active?'true':'false');button.textContent=active?'♥ In favorites':'♡ Add to favorites'};paint();button.addEventListener('click',function(){var i=ids.indexOf(id);if(i===-1)ids.push(id);else ids.splice(i,1);write(ids);paint()})}if(location.pathname==='/favorites/'||/\/(?:cn|cz|dk|nl|ee|fi|fr|de|gr|it|jp|kr|no|pl|pt|ru|es|se)\/favorites\/$/.test(location.pathname)){var cards=document.querySelectorAll('.video-loop .video-block'),shown=0;cards.forEach(function(card){var a=card.querySelector('a[href*="/videos/"]'),m=a&&a.getAttribute('href').match(/\/videos\/(\d+)-/);if(!m||ids.indexOf(m[1])===-1)card.style.display='none';else shown++});if(!shown){var grid=document.querySelector('.video-loop>.row,.video-loop .row.no-gutters');if(grid){var empty=document.createElement('div');empty.className='jm-favorites-empty';empty.textContent='No favorite videos yet. Add videos with the heart button.';grid.appendChild(empty)}}}})}());
3(function(){'use strict';function ready(fn){if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',fn,{once:true});else fn()}ready(function(){var box=document.querySelector('.jm-rating[data-rating-id]');if(!box)return;var id=box.dataset.ratingId,url=box.dataset.ratingUrl,likes=box.querySelector('[data-rating-likes]'),dislikes=box.querySelector('[data-rating-dislikes]');function paint(d){likes.textContent=d.likes||0;dislikes.textContent=d.dislikes||0;box.querySelectorAll('[data-rating-vote]').forEach(function(b){b.setAttribute('aria-pressed',String(d.user_vote)===b.dataset.ratingVote?'true':'false')})}fetch(url+'?id='+encodeURIComponent(id),{credentials:'same-origin'}).then(function(r){return r.json()}
3).then(paint).catch(function(){});box.addEventListener('click',function(e){var b=e.target.closest('[data-rating-vote]');if(!b)return;var body=new URLSearchParams({id:id,vote:b.dataset.ratingVote});fetch(url,{method:'POST',credentials:'same-origin',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body.toString()}).then(function(r){return r.json()}).then(paint).catch(function(){})})})}());
4(function(){'use strict';function ready(fn){if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',fn,{once:true});else fn()}ready(function(){var path=location.pathname,isCategory=/^\/xxx-cat\//.test(path),isSearch=/^\/search\//.test(path),cap=isCategory||isSearch?10:25;document.querySelectorAll('.pagination').forEach(function(list){var links=Array.from(list.querySelectorAll('a.page-link')),hasCap=links.some(function(a){return a.textContent.trim()===String(cap)}),high=[];links.forEach(function(a){var href=a.getAttribute('href')||'',m=href.match(/\/page(\d+)\.html(?:$|[?#])/i)||href.match(/\/(?:ctr|date|duration)\/(\d+)\/(?:$|[?#])/i);if(m&&parseInt(m[1],10)>cap)high.push(a)});if(!hasCap&&high.length){var first=high.shift(),href=first.getAttribute('href')||'';if(isCategory)first.setAttribute('href',href.replace(/\/(ctr|date|duration)\/\d+\//i,'/$1/'+cap+'/'));else first.setAttribute('href',href.replace(/\/page\d+\.html/i,'/page'+cap+'.html'));first.textContent=String(cap)}high.forEach(function(a){var item=a.closest('.page-item');if(item)item.remove();else a.remove()});Array.from(list.querySelectorAll('.page-gap')).forEach(function(gap){var next=gap.nextElementSibling;if(!next||!next.querySelector('a.page-link'))gap.remove()})})})}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.