Compare commits
No commits in common. "2261e753d543314443100019a80ab3829d797b87" and "f37beb0a5d1c104dbb8930f541f749de849013da" have entirely different histories.
2261e753d5
...
f37beb0a5d
@ -22,12 +22,5 @@ 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()
|
||||||
};
|
};
|
||||||
|
|
||||||
TeleTok.LogMessage(ErrorMessage);
|
Console.WriteLine(ErrorMessage);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,16 +12,15 @@ namespace TeleTok
|
|||||||
string url = videourl;
|
string url = videourl;
|
||||||
string proxyUrl;
|
string proxyUrl;
|
||||||
|
|
||||||
TeleTok.LogMessage("Video for " + videourl + " processing..");
|
DateTime now =DateTime.Now;
|
||||||
|
|
||||||
if(url.Contains("vm.tiktok.com"))
|
if(url.Contains("vm.tiktok.com"))
|
||||||
{
|
{
|
||||||
url = UnshortenUrl(url);
|
url = UnshortenUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyUrl = CreateDownloadLink(url);
|
proxyUrl = TeleTok.ptInstance + "/download?url=" + url;
|
||||||
|
Console.WriteLine("[" + now.ToString() + "] " + "Video for " + url + " has been sent..");
|
||||||
TeleTok.LogMessage("");
|
|
||||||
|
|
||||||
return proxyUrl;
|
return proxyUrl;
|
||||||
}
|
}
|
||||||
@ -36,25 +35,5 @@ 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