This commit is contained in:
ManeraKai 2023-02-07 20:46:39 +03:00
parent 97365e1237
commit 412fe20070
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
4 changed files with 27 additions and 38 deletions

View File

@ -1,32 +0,0 @@
pipeline:
instancefetch:
image: python:bullseye
secrets: [token, mail]
when:
- event: cron
cron: instance_updater
commands:
- python -m pip install --upgrade pip
- pip install requests colorama
- python src/instances/get_instances.py
# SSH configuration
- mkdir ~/.ssh
- ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts
- eval `ssh-agent`
- echo "$TOKEN" | tr -d '\r' | ssh-add -
# Git configuration
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
- git commit -am "updated instances"
- git remote set-url origin git@codeberg.org:libredirect/libredirect.git
- git push --set-upstream origin master
lint:
image: node:lts-alpine
when:
event: [push, pull_request]
path:
exclude: ["src/instances/**"]
include: ["src/**"]
commands:
- npm i
- npx web-ext lint --source-dir ./src/

View File

@ -5,13 +5,9 @@ A web extension that redirects YouTube, Twitter, TikTok... requests to alternati
[![Matrix Badge](https://img.shields.io/matrix/libredirect:matrix.org?label=matrix%20chat)](https://matrix.to/#/#libredirect:matrix.org)
[![Firefox users Badge](https://img.shields.io/amo/users/libredirect?label=Firefox%20users)](https://addons.mozilla.org/firefox/addon/libredirect/)
[![LibrePay Badge](https://img.shields.io/liberapay/gives/libredirect?label=Liberapay)](https://liberapay.com/LibRedirect)
[![OpenCollective Badge](https://opencollective.com/libredirect/tiers/badge.svg)](https://opencollective.com/libredirect#category-CONTRIBUTE)
[![Firefox Add-on](./img/badge-amo.png)](https://addons.mozilla.org/firefox/addon/libredirect/) 
<a href="./chromium.md">
<img src ="./img/badge-chromium.png" height=60 >
</a>
@ -20,7 +16,7 @@ A web extension that redirects YouTube, Twitter, TikTok... requests to alternati
<img src ="./img/2.png" width=350>&nbsp;
<img src ="./img/3.png" width=350>&nbsp;
- Youtube <span>&#8594;</span> [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [CloudTube](https://sr.ht/~cadence/tube/), [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)
- Youtube <span>&#8594;</span> [Invidious](https://github.com/iv-org/invidious), [Piped](https://github.com/TeamPiped/Piped), [Piped-Material](https://github.com/mmjee/Piped-Material), [CloudTube](https://sr.ht/~cadence/tube/), [PokeTube](https://codeberg.org/Ashley/poketube/), [FreeTube](https://github.com/FreeTubeApp/FreeTube), [Yattee](https://github.com/yattee/yattee)
- Youtube Music <span>&#8594;</span> [Beatbump](https://github.com/snuffyDev/Beatbump), [Hyperpipe](https://codeberg.org/Hyperpipe/Hyperpipe)
- Twitter <span>&#8594;</span> [Nitter](https://github.com/zedeus/nitter)
- TikTok <span>&#8594;</span> [ProxiTok](https://github.com/pablouser1/ProxiTok)
@ -39,8 +35,9 @@ A web extension that redirects YouTube, Twitter, TikTok... requests to alternati
- StackOverflow <span>&#8594;</span> [AnonymousOverflow](https://github.com/httpjamesm/AnonymousOverflow)
- Goodreads <span>&#8594;</span> [BiblioReads](https://github.com/nesaku/BiblioReads)
- Wikipedia <span>&#8594;</span> [Wikiless](https://wikiless.org)
- Snopes <span>&#8594;</span> [Suds](https://git.vern.cc/cobra/Suds)
# Please read the [FAQ](https://libredirect.github.io/faq.html) if you have any questions!
**Please read the [FAQ](https://libredirect.github.io/faq.html) if you have any questions!**
We're now on <a rel="me" href="https://fosstodon.org/@libredirect">Mastodon</a>

View File

@ -148,6 +148,19 @@ function redirect(url, type, initiator, forceRedirection) {
case "freetube": {
return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "")
}
case "poketube": {
if (url.pathname.startsWith('/channel')) {
const reg = /\/channel\/(.*)\/?$/.exec(url.pathname)
if (reg) {
const id = reg[1]
return `${randomInstance}/channel?id=${id}${url.search}`
}
}
if (/\/@[a-z]+\//.exec(url.pathname)) {
return randomInstance
}
return `${randomInstance}${url.pathname}${url.search}`
}
case "simplyTranslate": {
return `${randomInstance}/${url.search}`
}
@ -551,6 +564,7 @@ const defaultInstances = {
'piped': ['https://pipedapi-libre.kavin.rocks'],
'pipedMaterial': ['https://piped-material.xn--17b.net'],
'cloudtube': ['https://tube.cadence.moe'],
'poketube': ['https://poketube.fun'],
'proxiTok': ['https://proxitok.pabloferreiro.es'],
'send': ['https://send.vis.ee'],
'nitter': ['https://nitter.net'],

View File

@ -71,6 +71,16 @@
"embeddable": false,
"instanceList": false,
"url": "https://github.com/yattee/yattee"
},
"poketube": {
"excludeTargets": [
2,
3
],
"name": "PokeTube",
"embeddable": true,
"instanceList": true,
"url": "https://codeberg.org/Ashley/poketube/"
}
},
"targets": [