Compare commits
9 Commits
bugfixes/c
...
f37beb0a5d
Author | SHA1 | Date | |
---|---|---|---|
f37beb0a5d | |||
eec1050e17 | |||
8ffd920007 | |||
846b7d10d8 | |||
5adc9b7b9f | |||
3eb412bd6e | |||
1949c7af1b | |||
993a94ddb1 | |||
26dcd962b8 |
@ -4,11 +4,6 @@ type: docker
|
||||
name: publish-bot
|
||||
|
||||
steps:
|
||||
- name: build-dotnet
|
||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
commands:
|
||||
- dotnet publish
|
||||
|
||||
- name: build-image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@ -17,10 +12,8 @@ steps:
|
||||
from_secret: DOCKER_USER
|
||||
password:
|
||||
from_secret: DOCKER_PASS
|
||||
repo: git.kizaing.ca/kizaing/TeleTok
|
||||
repo: git.kizaing.ca/kizaing/teletok
|
||||
tags: latest
|
||||
platform: linux/amd64,linux/arm64
|
||||
|
||||
|
||||
# Commented out until stuff actually works
|
||||
trigger:
|
||||
|
13
Dockerfile
13
Dockerfile
@ -1,7 +1,14 @@
|
||||
FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3
|
||||
#Builds the bot from source
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-task
|
||||
|
||||
COPY . /build
|
||||
RUN cd /build && dotnet publish
|
||||
|
||||
# Actually runs the bot
|
||||
FROM mcr.microsoft.com/dotnet/runtime:6.0
|
||||
|
||||
WORKDIR /app/teletok
|
||||
|
||||
COPY bin/Debug/net6.0/publish/* /app/teletok/
|
||||
COPY --from=build-task /build/bin/Debug/net6.0/publish/* /app/teletok/
|
||||
|
||||
CMD [ "TeleTok" ]
|
||||
CMD [ "./TeleTok" ]
|
@ -54,8 +54,6 @@ namespace TeleTok
|
||||
|
||||
// Passes the url along to the video downloader if it is valid AND a tiktok link
|
||||
if (isUri)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(messageText.Contains("tiktok.com"))
|
||||
{
|
||||
@ -68,11 +66,6 @@ namespace TeleTok
|
||||
);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Valid TikTok URI was sent, but was not a video!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Task HandlePollingErrorAsync(ITelegramBotClient botClient, Exception exception, CancellationToken cancellationToken)
|
||||
|
@ -12,13 +12,15 @@ namespace TeleTok
|
||||
string url = videourl;
|
||||
string proxyUrl;
|
||||
|
||||
DateTime now =DateTime.Now;
|
||||
|
||||
if(url.Contains("vm.tiktok.com"))
|
||||
{
|
||||
url = UnshortenUrl(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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user