diff --git a/src/views/MagnetHandler.vue b/src/views/MagnetHandler.vue index ff362721..b85b955f 100644 --- a/src/views/MagnetHandler.vue +++ b/src/views/MagnetHandler.vue @@ -7,9 +7,19 @@ import { General } from '@/mixins' export default { name: 'MagnetHandler', mixins: [General], + methods: { + decodeMagnet(url) { + if (url.startsWith('magnet:?')) { + return url + } else { + return this.decodeMagnet(decodeURIComponent(url)) + } + } + }, created() { const regex = new RegExp('^\/download\=(.+?)(?:\/(?=$))?$', 'is') - this.createModal('AddModal', { initialMagnet: regex.exec(this.$route.fullPath)[1] }) + let magnetLink = this.decodeMagnet(regex.exec(this.$route.fullPath)[1]) + this.createModal('AddModal', { initialMagnet: magnetLink }) this.$router.push({ name: 'dashboard' }) } }