feat(gui): trackers basic display

This commit is contained in:
Alexey Kasyanchuk
2018-08-15 12:38:19 +03:00
parent 17371bd8ff
commit 7cf5c17fe4
7 changed files with 42 additions and 12 deletions

View File

@ -14,7 +14,12 @@ module.exports = class Nyaa
async parse()
{
let html = await fetch('https://nyaa.si/' + (this.threadId ? `view/${this.threadId}` : (this.hash ? `?q=${this.hash}` : '')))
let html;
try {
html = await fetch('https://nyaa.si/' + (this.threadId ? `view/${this.threadId}` : (this.hash ? `?q=${this.hash}` : '')))
} catch(err) {
return
}
if(!html)
return
html = await html.text()

View File

@ -14,7 +14,12 @@ module.exports = class Rutracker
async parse()
{
let html = await fetch('https://rutracker.org/forum/viewtopic.php?' + (this.threadId ? `t=${this.threadId}` : (this.hash ? `h=${this.hash}` : '')))
let html;
try {
html = await fetch('https://rutracker.org/forum/viewtopic.php?' + (this.threadId ? `t=${this.threadId}` : (this.hash ? `h=${this.hash}` : '')))
} catch(err) {
return
}
if(!html)
return
html = await html.text()