Compare commits

...

2 Commits

Author SHA1 Message Date
Chris Plaatjes
f37beb0a5d Removed try/catch it broke
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-15 10:05:30 -05:00
Chris Plaatjes
eec1050e17 Added datetime for logging 2023-02-15 10:05:14 -05:00
2 changed files with 10 additions and 15 deletions

View File

@ -55,22 +55,15 @@ namespace TeleTok
// Passes the url along to the video downloader if it is valid AND a tiktok link // Passes the url along to the video downloader if it is valid AND a tiktok link
if (isUri) if (isUri)
{ {
try if(messageText.Contains("tiktok.com"))
{ {
if(messageText.Contains("tiktok.com")) proxyUrl = VidDownload.TikTokURL(messageText);
{
proxyUrl = VidDownload.TikTokURL(messageText);
Message ttVideo = await botClient.SendVideoAsync( Message ttVideo = await botClient.SendVideoAsync(
chatId: chatId, chatId: chatId,
video: proxyUrl, video: proxyUrl,
cancellationToken: cancellationToken cancellationToken: cancellationToken
); );
}
}
catch
{
Console.WriteLine("Valid TikTok URI was sent, but was not a video!");
} }
} }
} }

View File

@ -12,13 +12,15 @@ namespace TeleTok
string url = videourl; string url = videourl;
string proxyUrl; string proxyUrl;
DateTime now =DateTime.Now;
if(url.Contains("vm.tiktok.com")) if(url.Contains("vm.tiktok.com"))
{ {
url = UnshortenUrl(url); url = UnshortenUrl(url);
} }
proxyUrl = TeleTok.ptInstance + "/download?url=" + url; proxyUrl = TeleTok.ptInstance + "/download?url=" + url;
Console.WriteLine("Video for " + url + " has been sent.."); Console.WriteLine("[" + now.ToString() + "] " + "Video for " + url + " has been sent..");
return proxyUrl; return proxyUrl;
} }