Skip to content

Commit

Permalink
Bump 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus7G authored Jul 30, 2022
1 parent b8b2704 commit bd0c968
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 17 deletions.
14 changes: 14 additions & 0 deletions Crunchyroll_Premium/blockevidon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
window.evidon_dg = {}

Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", {
get: function () { return ['wvc-x-callback:']; },
});
Object.defineProperty(window.evidon_dg, "productNames", {
get: function () { return {}; },
});
Object.defineProperty(window.evidon_dg, "loadedProducts", {
get: function () { return []; },
});
Object.defineProperty(window.evidon_dg, "productIds", {
get: function () { return []; },
});
19 changes: 16 additions & 3 deletions Crunchyroll_Premium/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ function importBetaPlayer(ready = false) {
setTimeout(() => importBetaPlayer(!!videoPlayer), 100);
return;
}
var lastWatchedPlayer = query('#frame');
if (query('.video-player') && lastWatchedPlayer)
lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer);

console.log("[CR Beta] Removendo player da Crunchyroll...");
remove('.video-player-placeholder', 'Video Placeholder')
remove('.video-player-placeholder', 'Video Placeholder');
remove('.video-player', 'Video Player', true);
remove('.blocked-stream-overlay', 'Blocked Overlay', true);
videoPlayer.src = '';
const appendTo = videoPlayer.parentNode;
appendTo.removeChild(videoPlayer);

console.log("[CR Beta] Pegando dados da stream...");
var external_lang = preservedState.localization.locale.toLowerCase()
Expand All @@ -94,12 +99,14 @@ function importBetaPlayer(ready = false) {
var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}`
var up_next = document.querySelector('[data-t="next-episode"] > a')
var playback = ep.playback
var series = document.querySelector('.show-title-link > h4')?.innerText;

var message = {
'playback': playback,
'old_url': old_url,
'lang': ep_lang,
'up_next': up_next ? up_next.href : undefined,
'series': series ? series : undefined,
}

console.log("[CR Beta] Adicionando o jwplayer...");
Expand Down Expand Up @@ -127,7 +134,7 @@ function addPlayer(element, playerInfo, beta = false) {
playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown;
playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir;
playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4;
playerInfo['version'] = '1.2.1';
playerInfo['version'] = '1.2.2';
playerInfo['noproxy'] = true;
playerInfo['beta'] = beta;
ifrm.contentWindow.postMessage(playerInfo, "*");
Expand Down Expand Up @@ -156,6 +163,7 @@ function registerChangeEpisode() {
if (currentURL !== window.location.href) {
currentURL = window.location.href
if (currentURL.includes("/watch/")) {
remove(".erc-watch-premium-upsell", "New Premium Sidebar", true)
const HTML = await fetch(currentURL)
console.log("[CR Beta] Searching for new INITIAL_STATE")
preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";"))
Expand Down Expand Up @@ -196,3 +204,8 @@ function fetch(url) {
xhr.send();
})
}

var s = document.createElement('script');
s.src = chrome.runtime.getURL('blockevidon.js');
s.onload = function () { this.remove(); };
(document.head || document.documentElement).appendChild(s);
6 changes: 5 additions & 1 deletion Crunchyroll_Premium/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Crunchyroll iFrame Player",
"version": "1.2.1",
"version": "1.2.2",
"description": "Permite ver todos os vídeos do crunchyroll gratuitamente.",
"author": "itallolegal",
"icons": {
Expand All @@ -16,6 +16,10 @@
"declarativeNetRequest",
"declarativeNetRequestFeedback"
],
"web_accessible_resources": [{
"resources": ["blockevidon.js"],
"matches": ["<all_urls>"]
}],
"host_permissions": [
"https://pl.crunchyroll.com/*",
"https://www.crunchyroll.com/*",
Expand Down
2 changes: 1 addition & 1 deletion Crunchyroll_Premium/popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 }
const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false }
const globalVariables = Object.keys(globalDefault)

chrome.storage.sync.get(globalVariables, function (items) {
Expand Down
14 changes: 14 additions & 0 deletions Crunchyroll_Premium_Kiwi-Browser/blockevidon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
window.evidon_dg = {}

Object.defineProperty(window.evidon_dg, "evidonCriticalDomains", {
get: function () { return ['wvc-x-callback:']; },
});
Object.defineProperty(window.evidon_dg, "productNames", {
get: function () { return {}; },
});
Object.defineProperty(window.evidon_dg, "loadedProducts", {
get: function () { return []; },
});
Object.defineProperty(window.evidon_dg, "productIds", {
get: function () { return []; },
});
19 changes: 16 additions & 3 deletions Crunchyroll_Premium_Kiwi-Browser/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ function importBetaPlayer(ready = false) {
setTimeout(() => importBetaPlayer(!!videoPlayer), 100);
return;
}
var lastWatchedPlayer = query('#frame');
if (query('.video-player') && lastWatchedPlayer)
lastWatchedPlayer.parentNode.removeChild(lastWatchedPlayer);

console.log("[CR Beta] Removendo player da Crunchyroll...");
remove('.video-player-placeholder', 'Video Placeholder')
remove('.video-player-placeholder', 'Video Placeholder');
remove('.video-player', 'Video Player', true);
remove('.blocked-stream-overlay', 'Blocked Overlay', true);
videoPlayer.src = '';
const appendTo = videoPlayer.parentNode;
appendTo.removeChild(videoPlayer);

console.log("[CR Beta] Pegando dados da stream...");
var external_lang = preservedState.localization.locale.toLowerCase()
Expand All @@ -153,12 +158,14 @@ function importBetaPlayer(ready = false) {
var old_url = `https://www.crunchyroll.com/${external_lang}/${series_slug}/episode-${external_id}`
var up_next = document.querySelector('[data-t="next-episode"] > a')
var playback = ep.playback
var series = document.querySelector('.show-title-link > h4')?.innerText;

var message = {
'playback': playback,
'old_url': old_url,
'lang': ep_lang,
'up_next': up_next ? up_next.href : undefined,
'series': series ? series : undefined,
}

console.log("[CR Beta] Adicionando o jwplayer...");
Expand Down Expand Up @@ -186,7 +193,7 @@ function addPlayer(element, playerInfo, beta = false) {
playerInfo['up_next_cooldown'] = items.cooldown === undefined ? 5 : items.cooldown;
playerInfo['up_next_enable'] = items.aseguir === undefined ? true : items.aseguir;
playerInfo['force_mp4'] = items.forcemp4 === undefined ? false : items.forcemp4;
playerInfo['version'] = '1.2.1';
playerInfo['version'] = '1.2.2';
playerInfo['noproxy'] = true;
playerInfo['beta'] = beta;
ifrm.contentWindow.postMessage(playerInfo, "*");
Expand Down Expand Up @@ -233,6 +240,7 @@ function registerChangeEpisode() {
if (currentURL !== window.location.href) {
currentURL = window.location.href
if (currentURL.includes("/watch/")) {
remove(".erc-watch-premium-upsell", "New Premium Sidebar", true)
const HTML = await fetch(currentURL)
console.log("[CR Beta] Searching for new INITIAL_STATE")
preservedState = JSON.parse(pegaString(HTML, "__INITIAL_STATE__ = ", ";"))
Expand Down Expand Up @@ -273,3 +281,8 @@ function fetch(url) {
xhr.send();
})
}

var s = document.createElement('script');
s.src = chrome.runtime.getURL('blockevidon.js');
s.onload = function () { this.remove(); };
(document.head || document.documentElement).appendChild(s);
6 changes: 5 additions & 1 deletion Crunchyroll_Premium_Kiwi-Browser/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Crunchyroll iFrame Player",
"version": "1.2.1",
"version": "1.2.2",
"description": "Permite ver todos os vídeos do crunchyroll gratuitamente.",
"author": "itallolegal",
"icons": {
Expand All @@ -16,6 +16,10 @@
"declarativeNetRequest",
"declarativeNetRequestFeedback"
],
"web_accessible_resources": [{
"resources": ["blockevidon.js"],
"matches": ["<all_urls>"]
}],
"host_permissions": [
"https://pl.crunchyroll.com/*",
"https://www.crunchyroll.com/*",
Expand Down
2 changes: 1 addition & 1 deletion Crunchyroll_Premium_Kiwi-Browser/popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const globalDefault = { 'webvideocaster': false, 'cooldown': false, 'aseguir': true, 'forcemp4': 5 }
const globalDefault = { 'webvideocaster': false, 'cooldown': 5, 'aseguir': true, 'forcemp4': false }
const globalVariables = Object.keys(globalDefault)

chrome.storage.sync.get(globalVariables, function (items) {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Obrigado por utilizar. :)
Você pode encontrar as últimas versões disponíveis abaixo:


<a href="https://github.com/mateus7g/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Desktop" src="https://img.shields.io/badge/desktop-v1.2.1-violet?style=for-the-badge&logo=windows"></a>
<a href="https://github.com/mateus7g/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Desktop" src="https://img.shields.io/badge/desktop-v1.2.2-violet?style=for-the-badge&logo=windows"></a>

#### Desktop (PC)

Atualmente a versão para Desktop está disponível [aqui](https://github.com/Mateus7G/crp-iframe-player/releases/latest).
Para instalar veja o passo a passo [para pc](#%EF%B8%8F-como-instalar-desktop).

<a href="https://github.com/Mateus7G/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Android" src="https://img.shields.io/badge/android-v1.2.1-violet?style=for-the-badge&logo=android"></a>
<a href="https://github.com/Mateus7G/crp-iframe-player/releases/latest" target="_blank"><img align="right" alt="Android" src="https://img.shields.io/badge/android-v1.2.2-violet?style=for-the-badge&logo=android"></a>

#### Android (Kiwi)

Expand Down
2 changes: 1 addition & 1 deletion assets/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ window.addEventListener("message", async e => {
playerInstance.addButton(...webvideocasterBtn);
else
playerInstance.addButton(...downloadBtn);
if (!tampermonkey && version !== "1.2.1")
if (!tampermonkey && version !== "1.2.2")
playerInstance.addButton(...updateBtn);

// Definir URL e Tamanho na lista de download
Expand Down
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,23 @@
<button class="close-modal">×</button>
<div class="download-item">
<span class="partdditem quality not-copyable">Changelog</span>
<span class="partdditem size not-copyable">v1.2.1</span>
<span class="partdditem size not-copyable">v1.2.2</span>
</div>
<div class="download-item">
<span id="changelog" class="partdditem quality not-copyable" style="font-family: 'SFProDisplay-Regular';">
<strong>Update available:</strong><br/>
- Fix <strong>Crunchyroll Beta</strong> compatibility<br/>
- Add WebVideoCaster button
- Fix WebVideoCaster button
- Fix popup default values
</span>
</div>
<div class="download-item">
<span class="partdditem quality not-copyable">Download (pc)</span>
<a class="partdditem down-icon" href="https://github.com/mateus7g/crp-iframe-player/releases/download/v1.2.1/Crunchyroll_Premium.zip" target="_top" download></a>
<a class="partdditem down-icon" href="https://github.com/mateus7g/crp-iframe-player/releases/download/v1.2.2/Crunchyroll_Premium.zip" target="_top" download></a>
</div>
<div class="download-item">
<span class="partdditem quality not-copyable">Download (kiwi)</span>
<a class="partdditem down-icon" href="https://github.com/mateus7g/crp-iframe-player/releases/download/v1.2.1/Crunchyroll_Premium_Kiwi-Browser.zip" target="_top" download></a>
<a class="partdditem down-icon" href="https://github.com/mateus7g/crp-iframe-player/releases/download/v1.2.2/Crunchyroll_Premium_Kiwi-Browser.zip" target="_top" download></a>
</div>
</div>
<div id="player_div"></div>
Expand Down

2 comments on commit bd0c968

@riquezinnn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not working :(

@Mateus7G
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.