Add magnet link to real-debrid
COMMENT
Add magnet link to real debrid.
v1.0
@justvinz
COMMENT
A valid Private API Token is required, get yours at https://real-debrid.com/apitoken
and paste it in the first message below.
TEXT
SZOINDWNWIBYTON3JVVLCO4DFWDSLSPG2GDWJBXK42SEHLSWLP6A

Text
VARIABLES
Set variable
token
to
Input
TEXT
Shortcut Input

Text
SCRIPTING
If
Input
Condition
SCRIPTING
Otherwise
SHARING
Get clipboard

Clipboard
SCRIPTING
End If

If Result
VARIABLES
Set variable
url
to
Input
TEXT
token

Text
SCRIPTING
If
Input
Condition
URL
https://app.real-debrid.com/rest/1.0/torrents/addMagnet/
url

URL
NETWORK
Get contents of
URL
Options Under Construction

Contents of URL
SCRIPTING
If
Input
Condition
SCRIPTING
Get
Value
for
error
in
Dictionary

Dictionary Value
SCRIPTING
SCRIPTING
Otherwise
SCRIPTING
Get
Value
for
id
in
Dictionary

Dictionary Value
VARIABLES
Add
Input
to
id
URL
https://app.real-debrid.com/rest/1.0/torrents/selectFiles/
id

URL
NETWORK
Get contents of
URL
Options Under Construction

Contents of URL
URL
https://app.real-debrid.com/rest/1.0/torrents/info/
id

URL
NETWORK
Get contents of
URL
Options Under Construction

Contents of URL
VARIABLES
Set variable
info
to
Input
SCRIPTING
Get
Value
for
status
in
Dictionary

Dictionary Value
VARIABLES
Set variable
status
to
Input
VARIABLES
Get
info
SCRIPTING
Get
Value
for
progress
in
Dictionary

Dictionary Value
VARIABLES
Set variable
progress
to
Input
SCRIPTING
Show
Status:
status
Progress:
progress
%
VARIABLES
Get
status
SCRIPTING
If
Input
Condition
VARIABLES
Get
info
SCRIPTING
Get
Value
for
links
in
Dictionary

Dictionary Value
SCRIPTING
Choose from
Input
Prompt
[{'class': 'magic', 'value': 'Valore dizionario', 'glyph': '', 'UUID': '52511B23-AB56-4FAE-A568-48321883FAB5'}]

Chosen Item
SHARING
Copy
Content
to clipboard
Expire At
[{'class': 'magic', 'value': 'Elemento scelto', 'glyph': '', 'UUID': '7DAE6FF9-5EC1-41FE-9339-F549083BB2AA'}]
SCRIPTING
Show alert
Links copied
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
SCRIPTING
Otherwise
SCRIPTING
Show alert
A token is required
Title
A token is required
URL
https://real-debrid.com/apitoken

URL
SAFARI
Open
Safari web page
SCRIPTING
End If

If Result
Showcuts