mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-06-27 18:40:31 +02:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
0fc06a78a7 | |||
90bed8b774 | |||
ac31945372 | |||
1683bf2035 | |||
af54a28737 | |||
0f8d323c3c | |||
4c1bfbde62 | |||
9889cf79a2 | |||
230eb074e9 | |||
2a9c00c3a8 | |||
16cf6688ec | |||
4edc3d5f84 | |||
e5552910b2 | |||
2db8381df7 | |||
55eac3c010 | |||
d93a5ea784 | |||
e41bc2b8ef | |||
052c0d1e78 | |||
1e7b9b3d8d | |||
fbb9a1d67b | |||
126aeee1f7 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build/
|
51
README.md
51
README.md
@ -6,9 +6,43 @@ This addon replaces the video player from this sides with the native player buil
|
||||
This has the advantage, that no advertising or popups are shown when trying to interact with the video (playing, skipping, ...) or some sites are showing them even if you do nothing.
|
||||
Additionally this enables you to download the video by right-clicking it and just choose the download option.
|
||||
|
||||
Supported streaming providers (for a complete list of all supported websites, see [here](SUPPORTED)):
|
||||
- [streamtape.com](https://streamtape.com/)
|
||||
- [vidoza.net](https://vidoza.net/)
|
||||
<p align="center">
|
||||
<a href="https://addons.mozilla.org/de/firefox/addon/stream-bypass/">
|
||||
<img src="https://img.shields.io/amo/users/stream-bypass?label=Firefox%20Addon%20Store&style=flat-square" alt="Firefox Addon Store">
|
||||
</a>
|
||||
<a href="https://github.com/ByteDream/stream-bypass/releases/latest">
|
||||
<img src="https://img.shields.io/github/downloads/ByteDream/stream-bypass/total?label=GitHub%20Downloads&style=flat-square" alt="GitHub Downloads">
|
||||
</a>
|
||||
<a href="https://discord.gg/gUWwekeNNg">
|
||||
<img src="https://img.shields.io/discord/915659846836162561?label=discord&style=flat-square" alt="Discord">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Supported streaming providers (for a complete list of all supported websites, see [here](SUPPORTED) or in [show all](#all-supported-websites) below):
|
||||
- [streamtape.com](https://streamtape.com)
|
||||
- [vivo.sx](https://vivo.sx)
|
||||
- [voe.sx](https://voe.sx)
|
||||
|
||||
<details id="all-supported-websites">
|
||||
<summary><b>Show all</b></summary>
|
||||
<ul>
|
||||
<li><a href="https://evoload.io">evoload.io</a></li>
|
||||
<li><a href="https://mcloud.to">mcloud.to</a></li>
|
||||
<li><a href="https://mixdrop.co">mixdrop.co</a></li>
|
||||
<li><a href="https://streamtape.com">streamtape.com</a></li>
|
||||
<li><a href="https://streamzz.to">streamzz.to</a></li>
|
||||
<li><a href="https://thevideome.com">thevideome.com</a></li>
|
||||
<li><a href="https://vidlox.me">vidlox.me</a></li>
|
||||
<li><a href="https://vidstream.pro">vidstream.pro</a></li>
|
||||
<li><a href="https://vidoza.net">vidoza.net</a></li>
|
||||
<li><a href="https://vivo.st">vivo.st</a></li>
|
||||
<li><a href="https://vivo.sx">vivo.sx</a></li>
|
||||
<li><a href="https://voe.sx">voe.sx</a></li>
|
||||
<li><a href="https://vupload.com">vupload.com</a></li>
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
<details id="example">
|
||||
<summary><b>How it's working</b></summary>
|
||||
@ -16,9 +50,10 @@ Supported streaming providers (for a complete list of all supported websites, se
|
||||
</details>
|
||||
|
||||
The addon was tested on
|
||||
- Firefox (92.0)
|
||||
- Chromium (92.0)
|
||||
- Opera (78.0)
|
||||
- Firefox (96.0.3)
|
||||
- Ungoogled Chromium (97.0)
|
||||
- Vivaldi (5.0)
|
||||
- Opera (83.0)
|
||||
|
||||
## Installing
|
||||
|
||||
@ -28,7 +63,7 @@ Install the addon directly from the [firefox addon store](https://addons.mozilla
|
||||
|
||||
### Chromium / Google Chrome
|
||||
|
||||
1. Download the `stream-bypass-<version>.zip` file from the [latest release](https://github.com/ByteDream/stream-bypass/releases/latest) and unzip it (with [7zip](https://www.7-zip.org/) or something like that).
|
||||
1. Download the zipfile from the [latest release](https://smartrelease.bytedream.org/github/ByteDream/stream-bypass/stream_bypass-{tag}.zip) and unzip it (with [7zip](https://www.7-zip.org/) or something like that).
|
||||
2. Go into your browser and type `chrome://extensions` in the address bar.
|
||||
3. Turn the developer mode in the top right corner on.
|
||||
4. Click Load unpacked.
|
||||
@ -36,7 +71,7 @@ Install the addon directly from the [firefox addon store](https://addons.mozilla
|
||||
|
||||
### Opera
|
||||
|
||||
1. Download the `stream-bypass-<version>.zip` file from the [latest release](https://github.com/ByteDream/stream-bypass/releases/latest) and unzip it (with [7zip](https://www.7-zip.org/) or something like that).
|
||||
1. Download the zipfile from the [latest release](https://smartrelease.bytedream.org/github/ByteDream/stream-bypass/stream_bypass-{tag}.zip) and unzip it (with [7zip](https://www.7-zip.org/) or something like that).
|
||||
2. Go into your browser and type `opera://extensions` in the address bar.
|
||||
3. Turn the developer mode in the top right corner on.
|
||||
4. Click Load unpacked.
|
||||
|
@ -4,7 +4,6 @@ mixdrop.co
|
||||
streamtape.com
|
||||
streamzz.to
|
||||
thevideome.com
|
||||
upstream.to
|
||||
vidlox.me
|
||||
vidstream.pro
|
||||
vidoza.net
|
||||
|
67
build.py
67
build.py
@ -1,8 +1,11 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import io
|
||||
import json
|
||||
import sys
|
||||
import urllib.request
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
@ -21,7 +24,8 @@ def load_matches():
|
||||
else:
|
||||
match = pattern.findall(line)
|
||||
if match:
|
||||
matched.append(match[0])
|
||||
if not line.strip().startswith('//'):
|
||||
matched.append(match[0])
|
||||
else:
|
||||
break
|
||||
|
||||
@ -35,13 +39,6 @@ def write_manifest():
|
||||
for content_script in manifest['content_scripts']:
|
||||
content_script['matches'] = [f'*://{match}/*' for match in matches]
|
||||
|
||||
domains = []
|
||||
for match in matches:
|
||||
toplevel = match.split('.')[-1]
|
||||
if toplevel not in domains:
|
||||
domains.append(toplevel)
|
||||
manifest['content_security_policy'] = f"script-src 'self' blob: https://cdn.jsdelivr.net https://unpkg.com {' '.join(f'*.{toplevel}' for toplevel in domains)}; object-src 'self'"
|
||||
|
||||
json.dump(manifest, open('src/manifest.json', 'w'), indent=2)
|
||||
|
||||
|
||||
@ -49,6 +46,42 @@ def write_supported():
|
||||
open('SUPPORTED', 'w').writelines([f'{match}\n' for match in load_matches()])
|
||||
|
||||
|
||||
def write_readme():
|
||||
firefox_pattern = re.compile(r'Mozilla Firefox (?P<version>.+)')
|
||||
chromium_pattern = re.compile(r'(?P<version>\d+\.\d+)')
|
||||
tested = {}
|
||||
|
||||
stdout, stderr = subprocess.Popen(['firefox', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||
if stderr == b'':
|
||||
tested['Firefox'] = re.search(firefox_pattern, stdout.decode('utf-8').replace('\n', '')).group('version')
|
||||
|
||||
for command, name in {'chromium': 'Ungoogled Chromium', 'vivaldi-stable': 'Vivaldi', 'opera': 'Opera'}.items():
|
||||
stdout, stderr = subprocess.Popen([command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||
if stderr == b'':
|
||||
tested[name] = re.search(chromium_pattern, stdout.decode('utf-8').replace('\n', '')).group('version')
|
||||
|
||||
# it this the right syntax if i want to read and write to a file? * dreams in python3.10 *
|
||||
with open('README.md', 'r') as read_file:
|
||||
readme = read_file.read()
|
||||
|
||||
# adds all available websites
|
||||
all_providers_regex = r'(?<=<ul>\n)(.+?)(?=</ul>)'
|
||||
domains = filter(lambda domain: domain != '', open('SUPPORTED', 'r').read().split('\n'))
|
||||
all_providers = '\n'.join(f'\t\t<li><a href="https://{supported}">{supported}</a></li>' for supported in domains) + '\n'
|
||||
readme = re.sub(all_providers_regex, all_providers, readme, flags=re.DOTALL)
|
||||
|
||||
# adds all installed browsers to the tested browser section. i'm just to lazy to seek out all browser versions manually
|
||||
tested_browsers_regex = r'(?<=The addon was tested on\n)(.+?)(?=\n*## Installing)'
|
||||
tested_browsers = '\n'.join(f'- {name} ({version})' for name, version in tested.items())
|
||||
readme = re.sub(tested_browsers_regex, tested_browsers, readme, flags=re.DOTALL)
|
||||
|
||||
# rewrite the readme
|
||||
with open('README.md', 'w') as write_file:
|
||||
write_file.write(readme)
|
||||
write_file.close()
|
||||
read_file.close()
|
||||
|
||||
|
||||
def copy_built():
|
||||
if not shutil.which('tsc'):
|
||||
sys.stderr.write('The typescript compiler `tsc` could not be found')
|
||||
@ -78,6 +111,21 @@ def copy_built():
|
||||
elif file.suffix != '.ts':
|
||||
shutil.copy(str(file), str(build_file))
|
||||
|
||||
ext_path = Path('build', 'ext')
|
||||
if not ext_path.is_dir():
|
||||
ext_path.mkdir()
|
||||
|
||||
# download hls.js (version 1.1.1)
|
||||
with zipfile.ZipFile(io.BytesIO(urllib.request.urlopen('https://github.com/video-dev/hls.js/releases/download/v1.1.1/release.zip').read())) as z:
|
||||
open(ext_path.joinpath('hls.light.min.js'), 'wb').write(z.read('dist/hls.light.min.js'))
|
||||
z.close()
|
||||
|
||||
# download popperjs core (version 2.10.2)
|
||||
open(ext_path.joinpath('popper.min.js'), 'wb').write(urllib.request.urlopen('https://unpkg.com/@popperjs/core@2.10.2/dist/umd/popper.min.js').read())
|
||||
|
||||
# download tippy.js (version 6.3.7)
|
||||
open(ext_path.joinpath('tippy-bundle.umd.min.js'), 'wb').write(urllib.request.urlopen('https://unpkg.com/tippy.js@6.3.7/dist/tippy-bundle.umd.min.js').read())
|
||||
|
||||
|
||||
def clean_build():
|
||||
for file in Path('src').rglob('*'):
|
||||
@ -88,6 +136,7 @@ def clean_build():
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-m', '--manifest', action='store_true', help='Builds the manifest.json file for addon information in ./src')
|
||||
parser.add_argument('-r', '--readme', action='store_true', help='Updates the README.md with the currently installed ')
|
||||
parser.add_argument('-s', '--supported', action='store_true', help='Builds the SUPPORTED file with all supported domains in the current directory')
|
||||
parser.add_argument('-b', '--build', action='store_true', help='Creates a ./build folder and builds all typescript / sass files')
|
||||
parser.add_argument('-c', '--clean', action='store_true', help='Cleans the ./src folder from .js, .css and .map files')
|
||||
@ -96,6 +145,8 @@ if __name__ == '__main__':
|
||||
|
||||
if parsed.manifest:
|
||||
write_manifest()
|
||||
if parsed.readme:
|
||||
write_readme()
|
||||
if parsed.supported:
|
||||
write_supported()
|
||||
if parsed.build:
|
||||
|
@ -2,8 +2,8 @@
|
||||
"manifest_version": 2,
|
||||
"name": "Stream Bypass",
|
||||
"author": "ByteDream",
|
||||
"description": "",
|
||||
"version": "1.2.0",
|
||||
"description": "A multi-browser addon / extension for multiple streaming providers which redirects directly to the source video.",
|
||||
"version": "1.5.1",
|
||||
"homepage_url": "https://github.com/ByteDream/stream-bypass",
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
@ -20,7 +20,6 @@
|
||||
"*://streamtape.com/*",
|
||||
"*://streamzz.to/*",
|
||||
"*://thevideome.com/*",
|
||||
"*://upstream.to/*",
|
||||
"*://vidlox.me/*",
|
||||
"*://vidstream.pro/*",
|
||||
"*://vidoza.net/*",
|
||||
@ -39,7 +38,6 @@
|
||||
"permissions": [
|
||||
"storage"
|
||||
],
|
||||
"content_security_policy": "script-src 'self' blob: https://cdn.jsdelivr.net https://unpkg.com *.io *.to *.co *.com *.me *.pro *.net *.st *.sx; object-src 'self'",
|
||||
"browser_action": {
|
||||
"default_icon": "icons/stream-bypass.png",
|
||||
"default_title": "Stream Bypass",
|
||||
|
12
src/match.ts
12
src/match.ts
@ -58,7 +58,7 @@ class TheVideoMe implements Match {
|
||||
|
||||
class Upstream implements Match {
|
||||
async match(match: RegExpMatchArray): Promise<string> {
|
||||
return `https://${match[48]}.upstreamcdn.co/hls/,${match.sort((a, b) => {return b.length - a.length})[0]},.urlset/master.m3u8`
|
||||
return `https://${match[47]}.upstreamcdn.co/hls/${match.sort((a, b) => {return b.length - a.length})[0]}/master.m3u8`
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,12 +96,6 @@ class Vivo implements Match {
|
||||
}
|
||||
}
|
||||
|
||||
class Vupload implements Match {
|
||||
async match(match: RegExpMatchArray): Promise<string> {
|
||||
return `https://www3.megaupload.to/${match[0]}/v.mp4`
|
||||
}
|
||||
}
|
||||
|
||||
// all domains to match. the matches must be structured like this:
|
||||
// [domain, regex match (can be null), class to call after match (can be null), reliability]
|
||||
// => the domain which should be redirected
|
||||
@ -120,12 +114,12 @@ const matches = [
|
||||
['streamtape.com', new RegExp(/id=\S*(?=')/gm), new Streamtape(), Reliability.NORMAL],
|
||||
['streamzz.to', new RegExp(/https?:\/\/get.streamz.tw\/getlink-\w+\.dll/gm), null, Reliability.NORMAL],
|
||||
['thevideome.com', new RegExp(/(?<=\|)\w{2,}/gm), new TheVideoMe(), Reliability.NORMAL],
|
||||
['upstream.to', new RegExp(/(?<=\|)\w{2,}/gm), new Upstream(), Reliability.LOW],
|
||||
//['upstream.to', new RegExp(/(?<=\|)\w{2,}/gm), new Upstream(), Reliability.LOW],
|
||||
['vidlox.me', new RegExp(/(?<=\[")\S+?(?=")/gm), null, Reliability.NORMAL],
|
||||
['vidstream.pro', new RegExp(/(?<=')\w+(?=';)/gm), new Vidstream(), Reliability.LOW],
|
||||
['vidoza.net', new RegExp(/(?<=src:(\s*)?")\S*(?=")/gm), null, Reliability.NORMAL],
|
||||
['vivo.st', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo(), Reliability.HIGH],
|
||||
['vivo.sx', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo(), Reliability.HIGH],
|
||||
['voe.sx', new RegExp(/https?:\/\/\S*m3u8(?=")/gm), null, Reliability.HIGH],
|
||||
['vupload.com', new RegExp(/(?<=class\|)\w*/gm), new Vupload(), Reliability.NORMAL]
|
||||
['vupload.com', new RegExp(/(?<=src:\s?").+?(?=")/gm), null, Reliability.NORMAL]
|
||||
]
|
||||
|
@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="popup.css">
|
||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
<script src="https://unpkg.com/tippy.js@6"></script>
|
||||
<script src="../ext/popper.min.js"></script>
|
||||
<script src="../ext/tippy-bundle.umd.min.js"></script>
|
||||
<script src="../match.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@ -19,6 +19,7 @@
|
||||
<hr>
|
||||
<table id="sub-container">
|
||||
</table>
|
||||
<a id="error" href="https://github.com/ByteDream/stream-bypass/issues/new">Something does not work as expected</a>
|
||||
</div>
|
||||
<script src="./popup.js"></script>
|
||||
</body>
|
||||
|
@ -24,6 +24,14 @@ a
|
||||
background-color: grey
|
||||
cursor: not-allowed
|
||||
|
||||
&#error
|
||||
border: none
|
||||
display: block
|
||||
font-weight: lighter
|
||||
font-size: 0.8rem
|
||||
text-align: center
|
||||
padding: 10px 0 5px 0
|
||||
|
||||
hr
|
||||
margin: 3px 0
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<title>m3u8</title>
|
||||
<link rel="stylesheet" href="/res/hls.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
||||
<script src="/ext/hls.light.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<video id="video"></video>
|
||||
|
@ -1,3 +1,6 @@
|
||||
body
|
||||
background-color: #131313
|
||||
|
||||
html, body, video
|
||||
width: 100%
|
||||
height: 100%
|
||||
@ -7,3 +10,7 @@ video
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 0
|
||||
|
||||
#message
|
||||
color: white
|
||||
text-align: center
|
||||
|
@ -1,6 +1,6 @@
|
||||
function showMessage(message: string) {
|
||||
let messageElement = document.getElementById('message') as HTMLParagraphElement
|
||||
messageElement.innerHTML = message
|
||||
messageElement.innerText = message
|
||||
messageElement.hidden = false
|
||||
document.getElementById('video').hidden = true
|
||||
}
|
||||
@ -27,7 +27,7 @@ function loadHls() {
|
||||
|
||||
switch (rawReliability) {
|
||||
case 1: // low
|
||||
message = `The reliability for this domain is low, so errors like this are common.
|
||||
message = `The reliability for this domain is low, errors like this are common.
|
||||
Try to choose another streaming provider (if existent) or deactivate the addon for this domain (${searchParams.get('domain')}) and try again`
|
||||
break
|
||||
case 2: // normal
|
||||
@ -35,8 +35,8 @@ function loadHls() {
|
||||
break
|
||||
case 3: // high
|
||||
message = `The reliability for this domains is high, errors like this are very unlikely to happen.
|
||||
Try to refresh the page and if the error still exists you might want to open a new issue <a href="https://github.com/ByteDream/stream-bypass/issues">here</a>.
|
||||
When your using <a href="https://www.torproject.org/">Tor</a> such errors have a slight chance to occur more often,
|
||||
Try to refresh the page and if the error still exists you might want to open a new issue <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>.
|
||||
When you're using <a href="https://www.torproject.org/">Tor</a> such errors have a slight chance to occur more often,
|
||||
so if this is the case just try to reload the page and see if you it's working then`
|
||||
break
|
||||
}
|
||||
@ -45,6 +45,8 @@ function loadHls() {
|
||||
showMessage(`Could not load hls video. ${message}`)
|
||||
}, rawReliability * 3000)
|
||||
|
||||
document.title = searchParams.get('domain')
|
||||
|
||||
// @ts-ignore
|
||||
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
||||
clearTimeout(thirdPartyFallback)
|
||||
@ -53,7 +55,7 @@ function loadHls() {
|
||||
})
|
||||
} else {
|
||||
// shows a message if hls is not supported
|
||||
showMessage(`Failed to play m3u8 video (hls is not supported). Try again or create a new issue <a href="https://github.com/ByteDream/stream-bypass/issues">here</a>`)
|
||||
showMessage(`Failed to play m3u8 video (hls is not supported). Try again or create a new issue <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>`)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user