Compare commits
4 Commits
f37beb0a5d
...
2261e753d5
Author | SHA1 | Date | |
---|---|---|---|
|
2261e753d5 | ||
|
88dd3b5908 | ||
|
f8f94b4afc | ||
|
309d7c0cd3 |
@ -22,5 +22,12 @@ namespace TeleTok
|
|||||||
listener.RunListener();
|
listener.RunListener();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void LogMessage(string text)
|
||||||
|
{
|
||||||
|
DateTime now =DateTime.Now;
|
||||||
|
|
||||||
|
Console.WriteLine("[" + now.ToString() + "] " + text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -77,7 +77,7 @@ namespace TeleTok
|
|||||||
_ => exception.ToString()
|
_ => exception.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
Console.WriteLine(ErrorMessage);
|
TeleTok.LogMessage(ErrorMessage);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,15 +12,16 @@ namespace TeleTok
|
|||||||
string url = videourl;
|
string url = videourl;
|
||||||
string proxyUrl;
|
string proxyUrl;
|
||||||
|
|
||||||
DateTime now =DateTime.Now;
|
TeleTok.LogMessage("Video for " + videourl + " processing..");
|
||||||
|
|
||||||
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 = CreateDownloadLink(url);
|
||||||
Console.WriteLine("[" + now.ToString() + "] " + "Video for " + url + " has been sent..");
|
|
||||||
|
TeleTok.LogMessage("");
|
||||||
|
|
||||||
return proxyUrl;
|
return proxyUrl;
|
||||||
}
|
}
|
||||||
@ -35,5 +36,25 @@ namespace TeleTok
|
|||||||
|
|
||||||
return realUrl;
|
return realUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Breaks apart the URL and extracts the User and Video ID to be processed into a working download link
|
||||||
|
static string CreateDownloadLink(string videourl)
|
||||||
|
{
|
||||||
|
Uri segmentedUri = new Uri(videourl);
|
||||||
|
segmentedUri = new Uri(segmentedUri.AbsoluteUri.Replace(segmentedUri.Query, string.Empty));
|
||||||
|
|
||||||
|
string videoUser = segmentedUri.Segments[1];
|
||||||
|
videoUser = videoUser.Replace(@"/", "");
|
||||||
|
string videoID = segmentedUri.Segments[3];
|
||||||
|
|
||||||
|
string fixedUrl = "https://www.tiktok.com/" + videoUser + "/video/" + videoID + @"&id=" + videoID + @"&user=" + videoUser.Remove(0);
|
||||||
|
|
||||||
|
string proxyLink = TeleTok.ptInstance + "/download?url=" + fixedUrl;
|
||||||
|
|
||||||
|
TeleTok.LogMessage("Input User ID is: " + videoUser);
|
||||||
|
TeleTok.LogMessage("Input video ID is: " + videoID);
|
||||||
|
|
||||||
|
return proxyLink;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user