mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-20 10:44:35 +10:00
Hide download icon and menu
This commit is contained in:
18
Install.ps1
18
Install.ps1
@@ -355,10 +355,15 @@ function OffAdsOnFullscreen {
|
|||||||
|
|
||||||
# Disabling a playlist sponsor
|
# Disabling a playlist sponsor
|
||||||
$playlist_ad_off = "allSponsorships"
|
$playlist_ad_off = "allSponsorships"
|
||||||
|
|
||||||
|
# Remove the menu item "download"
|
||||||
|
$menu_download = 'return .\(\).createElement\(....,\{value:"download-playlist"\},.\(\).createElement\(..,.\)\)'
|
||||||
|
|
||||||
if ($xpui_js -match $empty_block_ad[0]) { $xpui_js = $xpui_js -replace $empty_block_ad[0], $empty_block_ad[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$empty_block_ad[0] in xpui.js" }
|
if ($xpui_js -match $empty_block_ad[0]) { $xpui_js = $xpui_js -replace $empty_block_ad[0], $empty_block_ad[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$empty_block_ad[0] in xpui.js" }
|
||||||
if ($xpui_js -match $full_screen_1[0]) { $xpui_js = $xpui_js -replace $full_screen_1[0], $full_screen_1[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$full_screen_1[0] in xpui.js" }
|
if ($xpui_js -match $full_screen_1[0]) { $xpui_js = $xpui_js -replace $full_screen_1[0], $full_screen_1[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$full_screen_1[0] in xpui.js" }
|
||||||
if ($xpui_js -match $full_screen_2[0]) { $xpui_js = $xpui_js -replace $full_screen_2[0], $full_screen_2[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$full_screen_2[0] in xpui.js" }
|
if ($xpui_js -match $full_screen_2[0]) { $xpui_js = $xpui_js -replace $full_screen_2[0], $full_screen_2[1] } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$full_screen_2[0] in xpui.js" }
|
||||||
if ($xpui_js -match $playlist_ad_off) { $xpui_js = $xpui_js -replace $playlist_ad_off, "" } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$playlist_ad_off in xpui.js" }
|
if ($xpui_js -match $playlist_ad_off) { $xpui_js = $xpui_js -replace $playlist_ad_off, "" } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$playlist_ad_off in xpui.js" }
|
||||||
|
if ($xpui_js -match $menu_download) { $xpui_js = $xpui_js -replace $menu_download, "" } else { Write-Host "Didn't find variable " -ForegroundColor red -NoNewline; Write-Host "`$menu_download in xpui.js" }
|
||||||
$xpui_js
|
$xpui_js
|
||||||
}
|
}
|
||||||
function ExpFeature {
|
function ExpFeature {
|
||||||
@@ -536,6 +541,19 @@ If (Test-Path $xpui_spa_patch) {
|
|||||||
$writer.Close()
|
$writer.Close()
|
||||||
|
|
||||||
|
|
||||||
|
# xpui.css
|
||||||
|
$entry_xpui_css = $zip.GetEntry('xpui.css')
|
||||||
|
$reader = New-Object System.IO.StreamReader($entry_xpui_css.Open())
|
||||||
|
$xpuiContents_xpui_css = $reader.ReadToEnd()
|
||||||
|
$reader.Close()
|
||||||
|
|
||||||
|
$writer = New-Object System.IO.StreamWriter($entry_xpui_css.Open())
|
||||||
|
$writer.BaseStream.SetLength(0)
|
||||||
|
$writer.Write($xpuiContents_xpui_css)
|
||||||
|
# Hide download icon on different pages
|
||||||
|
$writer.Write([System.Environment]::NewLine + ' .BKsbV2Xl786X9a09XROH {display: none}')
|
||||||
|
$writer.Close()
|
||||||
|
|
||||||
|
|
||||||
# js minification
|
# js minification
|
||||||
$zip.Entries | Where-Object FullName -like '*.js' | ForEach-Object {
|
$zip.Entries | Where-Object FullName -like '*.js' | ForEach-Object {
|
||||||
|
|||||||
@@ -354,10 +354,15 @@ function OffAdsOnFullscreen {
|
|||||||
|
|
||||||
# Отключиние спонсорской рекламы в некоторых плейлистах
|
# Отключиние спонсорской рекламы в некоторых плейлистах
|
||||||
$playlist_ad_off = "allSponsorships"
|
$playlist_ad_off = "allSponsorships"
|
||||||
|
|
||||||
|
# Отключение в меню кнопки "Скачать"
|
||||||
|
$menu_download = 'return .\(\).createElement\(....,\{value:"download-playlist"\},.\(\).createElement\(..,.\)\)'
|
||||||
|
|
||||||
if ($xpui_js -match $empty_block_ad[0]) { $xpui_js = $xpui_js -replace $empty_block_ad[0], $empty_block_ad[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$empty_block_ad[0] в xpui.js" }
|
if ($xpui_js -match $empty_block_ad[0]) { $xpui_js = $xpui_js -replace $empty_block_ad[0], $empty_block_ad[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$empty_block_ad[0] в xpui.js" }
|
||||||
if ($xpui_js -match $full_screen_1[0]) { $xpui_js = $xpui_js -replace $full_screen_1[0], $full_screen_1[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$full_screen_1[0] в xpui.js" }
|
if ($xpui_js -match $full_screen_1[0]) { $xpui_js = $xpui_js -replace $full_screen_1[0], $full_screen_1[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$full_screen_1[0] в xpui.js" }
|
||||||
if ($xpui_js -match $full_screen_2[0]) { $xpui_js = $xpui_js -replace $full_screen_2[0], $full_screen_2[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$full_screen_2[0] в xpui.js" }
|
if ($xpui_js -match $full_screen_2[0]) { $xpui_js = $xpui_js -replace $full_screen_2[0], $full_screen_2[1] } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$full_screen_2[0] в xpui.js" }
|
||||||
if ($xpui_js -match $playlist_ad_off) { $xpui_js = $xpui_js -replace $playlist_ad_off, "" } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$playlist_ad_off в xpui.js" }
|
if ($xpui_js -match $playlist_ad_off) { $xpui_js = $xpui_js -replace $playlist_ad_off, "" } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$playlist_ad_off в xpui.js" }
|
||||||
|
if ($xpui_js -match $menu_download) { $xpui_js = $xpui_js -replace $menu_download, "" } else { Write-Host "Не нашел " -ForegroundColor red -NoNewline; Write-Host "переменную `$menu_download в xpui.js" }
|
||||||
$xpui_js
|
$xpui_js
|
||||||
}
|
}
|
||||||
function OffRujs {
|
function OffRujs {
|
||||||
@@ -671,13 +676,26 @@ If (Test-Path $xpui_spa_patch) {
|
|||||||
$xpuiContents_vendor = $reader.ReadToEnd()
|
$xpuiContents_vendor = $reader.ReadToEnd()
|
||||||
$reader.Close()
|
$reader.Close()
|
||||||
$xpuiContents_vendor = $xpuiContents_vendor `
|
$xpuiContents_vendor = $xpuiContents_vendor `
|
||||||
<# Disable Sentry" #> -replace "prototype\.bindClient=function\(\w+\)\{", '${0}return;'
|
<# Отключение Sentry" #> -replace "prototype\.bindClient=function\(\w+\)\{", '${0}return;'
|
||||||
$writer = New-Object System.IO.StreamWriter($entry_vendor_xpui.Open())
|
$writer = New-Object System.IO.StreamWriter($entry_vendor_xpui.Open())
|
||||||
$writer.BaseStream.SetLength(0)
|
$writer.BaseStream.SetLength(0)
|
||||||
$writer.Write($xpuiContents_vendor)
|
$writer.Write($xpuiContents_vendor)
|
||||||
$writer.Close()
|
$writer.Close()
|
||||||
|
|
||||||
|
|
||||||
|
# xpui.css
|
||||||
|
$entry_xpui_css = $zip.GetEntry('xpui.css')
|
||||||
|
$reader = New-Object System.IO.StreamReader($entry_xpui_css.Open())
|
||||||
|
$xpuiContents_xpui_css = $reader.ReadToEnd()
|
||||||
|
$reader.Close()
|
||||||
|
|
||||||
|
$writer = New-Object System.IO.StreamWriter($entry_xpui_css.Open())
|
||||||
|
$writer.BaseStream.SetLength(0)
|
||||||
|
$writer.Write($xpuiContents_xpui_css)
|
||||||
|
# Скрыть иконку скачивание на разных страницах
|
||||||
|
$writer.Write([System.Environment]::NewLine + ' .BKsbV2Xl786X9a09XROH {display: none}')
|
||||||
|
$writer.Close()
|
||||||
|
|
||||||
|
|
||||||
# минификация js
|
# минификация js
|
||||||
$zip.Entries | Where-Object FullName -like '*.js' | ForEach-Object {
|
$zip.Entries | Where-Object FullName -like '*.js' | ForEach-Object {
|
||||||
|
|||||||
Reference in New Issue
Block a user