fix: force add trackers

fix: only preload http torrent files
fix: include OTF fonts
This commit is contained in:
ThaUnknown 2023-09-03 16:41:26 +02:00
parent 5f73799ce4
commit e5abb02a7d
3 changed files with 4 additions and 3 deletions

View file

@ -111,7 +111,8 @@ class TorrentClient extends WebTorrent {
'wss://tracker.openwebtorrent.com',
'wss://tracker.webtorrent.dev',
'wss://tracker.files.fm:7073/announce',
'wss://tracker.btorrent.xyz/'
'wss://tracker.btorrent.xyz/',
atob('aHR0cDovL255YWEudHJhY2tlci53Zjo3Nzc3L2Fubm91bmNl')
]
})
break

View file

@ -94,7 +94,7 @@ export default class Parser {
})
parser.on('file', file => {
if (this.destroyed) return
if (file.mimetype.toLowerCase().includes('font') || file.filename.toLowerCase().endsWith('.ttf')) {
if (file.mimetype.toLowerCase().includes('font') || file.filename.toLowerCase().endsWith('.otf')) {
const data = new Uint8Array(file.data)
this.client.dispatch('file', { mimetype: file.mimetype, data }, [data.buffer])
}

View file

@ -46,7 +46,7 @@ export async function add (torrentID, hide) {
console.info('Torrent: adding torrent', { torrentID })
files.set([])
if (!hide) page.set('player')
if (typeof torrentID === 'string' && !torrentID.startsWith('magnet:')) {
if (typeof torrentID === 'string' && torrentID.startsWith('http')) {
// IMPORTANT, this is because node's get bypasses proxies, wut????
const res = await fetch(torrentID)
torrentID = new Uint8Array(await res.arrayBuffer())