Skip to content

Commit

Permalink
shorter token
Browse files Browse the repository at this point in the history
  • Loading branch information
trikko committed Oct 5, 2023
1 parent ba00db0 commit 57dac32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ int main(string[] args)
maxDays == size_t.max
&& maxDownloads == size_t.max
&& args.length == 1
&& deleteUrl.match(deleteUrlRegex)
&& (("https://transfer.sh/" ~ deleteUrl).match(deleteUrlRegex))
)
{
auto http = HTTP(deleteUrl);
auto http = HTTP("https://transfer.sh/" ~ deleteUrl);

// Ignore output
http.onReceive( (ubyte[] data) { return data.length; });
Expand Down Expand Up @@ -82,7 +82,7 @@ int main(string[] args)

if(!valid)
{
stderr.writeln("Usage: tshare [-d max-downloads] [-t max-days] <local-file-path> [remote-file-name]\n tshare -r <deletion-url>\n tshare --version");
stderr.writeln("Usage: tshare [-d max-downloads] [-t max-days] <local-file-path> [remote-file-name]\n tshare -r <token>\n tshare --version");
return 0;
}

Expand Down Expand Up @@ -149,7 +149,7 @@ int main(string[] args)
writeln("\r\x1b[1mLink:\x1b[32m ", url, " \x1b[0m");

if(deleteUrl.match(deleteUrlRegex))
writeln("\r\x1b[1mTo remove:\x1b[0m tshare -r ", deleteUrl);
writeln("\r\x1b[1mTo remove:\x1b[0m tshare -r ", deleteUrl["https://transfer.sh/".length .. $]);

return 0;

Expand Down

0 comments on commit 57dac32

Please sign in to comment.