Last active
July 18, 2017 15:47
-
-
Save CODeRUS/51d208c64d7bf0d2b004f92de182ecae to your computer and use it in GitHub Desktop.
Lostfilm unblock restricted content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Lostfilm restricted content unblock | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Userscript unblocking restricted content and make download buttons work again without changing ip address | |
| // @author coderus | |
| // @match http://www.lostfilm.tv/series/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| // unblock download button for completed season | |
| var movieDetailsBlock = document.querySelector('.movie-details-block'); | |
| if (movieDetailsBlock) { | |
| let btn2 = movieDetailsBlock.querySelector('.external-btn2'); | |
| if (btn2) { | |
| let dataCode = movieDetailsBlock.querySelector('.haveseen-btn').getAttribute('data-code'); | |
| let [serial, season] = dataCode.split('-'); | |
| let allEpisodes = '999'; | |
| btn2.setAttribute('onclick', `PlayEpisode('${serial}', '${season}', '${allEpisodes}')`); | |
| btn2.setAttribute('class', 'external-btn'); | |
| } | |
| } | |
| // unblock download buttons for all episodes at the season page | |
| var moviePartsList = document.querySelector('.movie-parts-list'); | |
| if (moviePartsList) { | |
| var episodesList = moviePartsList.querySelectorAll('tbody>tr'); | |
| for (let i = 0; i < episodesList.length; i++) { | |
| let episodeItem = episodesList[i]; | |
| let btn2 = episodeItem.querySelector('.external-btn2'); | |
| if (btn2) { | |
| var dataCode = episodeItem.querySelector('.haveseen-btn').getAttribute('data-code'); | |
| let [serial, season, episode] = dataCode.split('-'); | |
| btn2.setAttribute('onclick', `PlayEpisode('${serial}', '${season}', '${episode}')`); | |
| btn2.setAttribute('class', 'external-btn'); | |
| } | |
| } | |
| } | |
| // unblock download button at the episode page | |
| var overlayPane = document.querySelector('.overlay-pane'); | |
| if (overlayPane) { | |
| let btn2 = overlayPane.querySelector('.external-btn2'); | |
| if (btn2) { | |
| let dataCode = document.querySelector('.isawthat-btn').getAttribute('data-code'); | |
| let [serial, season, episode] = dataCode.split('-'); | |
| btn2.setAttribute('onclick', `PlayEpisode('${serial}', '${season}', '${episode}')`); | |
| btn2.setAttribute('class', 'external-btn'); | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment