Compare commits
42
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1041b21e96 | ||
|
|
96797141fa | ||
|
|
4ced92e3cc | ||
|
|
9b8c236ecf | ||
|
|
c7bb0fe543 | ||
|
|
2de68761af | ||
|
|
16806a90b9 | ||
|
|
800faf26ce | ||
|
|
a4623d1e60 | ||
|
|
6b2b6b3996 | ||
|
|
0998bf4b3f | ||
|
|
8a39d4a4b2 | ||
|
|
4edcac18eb | ||
|
|
36dc76f500 | ||
|
|
05154527db | ||
|
|
9732737d7d | ||
|
|
37d1057970 | ||
|
|
99407b6117 | ||
|
|
f01169b8fc | ||
|
|
536f0a6029 | ||
|
|
a5b19d112c | ||
|
|
2366863776 | ||
|
|
7237086810 | ||
|
|
fed8499119 | ||
|
|
48675b1291 | ||
|
|
451face0f3 | ||
|
|
b8ba273e0e | ||
|
|
80951ff41c | ||
|
|
45f318d8f2 | ||
|
|
1837e19968 | ||
|
|
d3345fe31d | ||
|
|
44508acf2b | ||
|
|
a0124a9313 | ||
|
|
2dcebb96cb | ||
|
|
90f5d27a16 | ||
|
|
4661627957 | ||
|
|
5a07f2f953 | ||
|
|
f77b27e9ee | ||
|
|
4ce9902947 | ||
|
|
7b79c80b35 | ||
|
|
9de0146cbb | ||
|
|
6da9c9c8da |
@@ -4,67 +4,86 @@ on: [push]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
env:
|
|
||||||
DOTNET_INSTALL_DIR: '.\.dotnet'
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
dotnet-version: [ '8.0.x' ]
|
dotnet-version: [ '8.0.x' ]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache dotnet
|
- name: Compute next version
|
||||||
id: cache-dotnet
|
id: versioning
|
||||||
uses: actions/cache@v3
|
run: |
|
||||||
with:
|
latest="${{ vars.VERSION }}"
|
||||||
path: ${{ env.DOTNET_INSTALL_DIR }}
|
next_version=$(echo "$latest" | awk -F. -v OFS=. '{$NF += 1 ; print}')
|
||||||
key: ${{ runner.os }}-dotnet-${{ matrix.dotnet-version }}
|
echo "Next version: $next_version"
|
||||||
restore-keys: ${{ runner.os }}-dotnet-${{ matrix.dotnet-version }}
|
echo "next_version=$next_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install dotnet
|
- name: Setup dotnet
|
||||||
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
|
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ matrix.dotnet-version }}
|
dotnet-version: ${{ matrix.dotnet-version }}
|
||||||
|
|
||||||
# - name: Setup dotnet
|
|
||||||
# uses: actions/setup-dotnet@v3
|
|
||||||
# with:
|
|
||||||
# dotnet-version: ${{ matrix.dotnet-version }}
|
|
||||||
# cache: true
|
|
||||||
# cache-dependency-path: packages.lock.json
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
- name: Test with dotnet
|
- name: Test with dotnet
|
||||||
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
|
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
|
||||||
- name: Build the package
|
- name: Build the package
|
||||||
run: dotnet build
|
run: dotnet build -p:Version=$next_version
|
||||||
- name: Publish the package
|
- name: Publish the package
|
||||||
run: dotnet publish
|
run: dotnet publish -p:PublishSingleFile=true --self-contained false --runtime win-x64
|
||||||
- name: List files in the repository
|
- name: copy the release before compression
|
||||||
run: |
|
run: cp -r /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/ .
|
||||||
ls /workspace/pi-ux-ce/Simpsons_generator/bin/
|
- uses: montudor/action-zip@v1
|
||||||
- name: List files in the repository
|
|
||||||
run: |
|
|
||||||
ls /workspace/pi-ux-ce/Simpsons_generator/bin/Debug/
|
|
||||||
- name: List files in the repository
|
|
||||||
run: |
|
|
||||||
ls /workspace/pi-ux-ce/Simpsons_generator/bin/Debug/net8.0/
|
|
||||||
- name: Commit changes
|
|
||||||
uses: EndBug/add-and-commit@v9
|
|
||||||
with:
|
with:
|
||||||
author_name: Pierre
|
args: zip -qq -r Simpsons_generator.zip publish/
|
||||||
author_email: pierre@geeraert.eu
|
#working-directory: path/to/work-dir
|
||||||
message: 'automated push of build'
|
- name: List all files
|
||||||
add: '/workspace/pi-ux-ce/Simpsons_generator/bin/Debug/net8.0/Simpsons_generator.exe'
|
run: |
|
||||||
- name: git push changes
|
find /workspace/pi-ux-ce/Simpsons_generator/bin
|
||||||
uses: appleboy/git-push-action@v0.0.2
|
|
||||||
with:
|
- name: Delete existing latest version
|
||||||
author_email: pierre@geeraert.eu
|
run: |
|
||||||
author_name: Pierre
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
|
||||||
branch: main
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.exe
|
||||||
commit: true
|
|
||||||
commit_message: "[skip ci] Updated changes by gitea bot"
|
- name: Delete existing latest version
|
||||||
remote: git@gitea.tryton.geeraert.eu:pi-ux-ce/Simpsons_generator.git
|
run: |
|
||||||
ssh_key: ${{ secrets.DEPLOY_KEY }}
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
|
||||||
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.zip
|
||||||
|
|
||||||
|
- name: upload latest zip version with version number
|
||||||
|
run: |
|
||||||
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
|
--upload-file Simpsons_generator.zip \
|
||||||
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/$next_version/Simpsons_generator.zip
|
||||||
|
|
||||||
|
|
||||||
|
- name: upload latest executable version with version number
|
||||||
|
run: |
|
||||||
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
|
--upload-file /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/Simpsons_generator.exe \
|
||||||
|
"https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/$next_version/Simpsons_generator.exe"
|
||||||
|
|
||||||
|
|
||||||
|
- name: upload latest zip version
|
||||||
|
run: |
|
||||||
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
|
--upload-file Simpsons_generator.zip \
|
||||||
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.zip
|
||||||
|
|
||||||
|
|
||||||
|
- name: upload latest executable version
|
||||||
|
run: |
|
||||||
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
|
--upload-file /workspace/pi-ux-ce/Simpsons_generator/bin/Release/net8.0/win-x64/publish/Simpsons_generator.exe \
|
||||||
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/Simpsons_generator/latest/Simpsons_generator.exe
|
||||||
|
|
||||||
|
|
||||||
|
- name: update version in the variable
|
||||||
|
run: |
|
||||||
|
curl -X PUT -H "Content-Type: application/json" \
|
||||||
|
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
|
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/Simpsons_generator/actions/variables/VERSION \
|
||||||
|
-d "{\"Value\":\"$next_version\"}"
|
||||||
+128
-106
@@ -1,5 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Data.SQLite;
|
||||||
|
using System.Net;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
@@ -7,15 +10,43 @@ namespace Simpsons_generator;
|
|||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
/* public static void openit(string x) {
|
|
||||||
System.Diagnostics.Process.Start("cmd", "/C start" + " " + x);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static readonly string folder_path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simpsons_generator");
|
private static readonly string FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Simpsons_generator");
|
||||||
public static readonly string filePath = Path.Combine(folder_path, "episodes-watched.csv");
|
private static readonly string OverrideBrowser = Path.Combine(FolderPath, "overrideBrowser.xml");
|
||||||
public static readonly string overrideBrowser = Path.Combine(folder_path, "overrideBrowser.xml");
|
public static readonly string filePath = Path.Combine(FolderPath, "episodes-watched.csv");
|
||||||
|
|
||||||
|
|
||||||
private static void openit(string url)
|
static SQLiteConnection CreateConnection()
|
||||||
|
{
|
||||||
|
|
||||||
|
SQLiteConnection sqliteconn;
|
||||||
|
|
||||||
|
if (!(File.Exists($"{FolderPath}/database.db")))
|
||||||
|
{
|
||||||
|
Console.WriteLine("Creating database.db");
|
||||||
|
using (var client = new WebClient())
|
||||||
|
{
|
||||||
|
client.DownloadFile("https://gitea.tryton.geeraert.eu//pi-ux-ce/Simpsons_generator/raw/branch/main/database.db", $"{FolderPath}/database.db");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new database connection:
|
||||||
|
var sqllitedatasource = $"Data Source={FolderPath}/database.db;Version=3;New=True;Compress=True;";
|
||||||
|
sqliteconn = new SQLiteConnection(sqllitedatasource);
|
||||||
|
// Open the connection:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
sqliteconn.Open();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
return sqliteconn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Openit(string url)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -26,12 +57,13 @@ class Program
|
|||||||
// hack because of this: https://github.com/dotnet/corefx/issues/10361
|
// hack because of this: https://github.com/dotnet/corefx/issues/10361
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("Using Windows");
|
||||||
url = url.Replace("&", "^&");
|
url = url.Replace("&", "^&");
|
||||||
if (File.Exists(overrideBrowser))
|
if (File.Exists(OverrideBrowser))
|
||||||
{
|
{
|
||||||
string browser_path = File.ReadAllText(overrideBrowser);
|
string browserPath = File.ReadAllText(OverrideBrowser);
|
||||||
Console.WriteLine("browser: "+browser_path);
|
Console.WriteLine("browser: "+browserPath);
|
||||||
Process.Start(new ProcessStartInfo(browser_path, url) { CreateNoWindow = true });
|
Process.Start(new ProcessStartInfo(browserPath, url) { CreateNoWindow = true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
|
||||||
@@ -40,10 +72,21 @@ class Program
|
|||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
{
|
{
|
||||||
Process.Start("xdg-open", url);
|
Console.WriteLine("Using Linux");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process.Start("xdg-open", url);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("Using Mac");
|
||||||
Process.Start("open", url);
|
Process.Start("open", url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -58,118 +101,98 @@ class Program
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static object RunSqlQuery(SQLiteConnection conn, string query)
|
||||||
private static bool CheckEpisodeAlreadyRun(string url)
|
|
||||||
{
|
{
|
||||||
if (File.Exists(filePath))
|
SQLiteDataReader sqliteDatareader;
|
||||||
|
SQLiteCommand sqliteCmd;
|
||||||
|
sqliteCmd = conn.CreateCommand();
|
||||||
|
sqliteCmd.CommandText = query;
|
||||||
|
sqliteDatareader = sqliteCmd.ExecuteReader();
|
||||||
|
if (sqliteDatareader.Read())
|
||||||
{
|
{
|
||||||
|
return sqliteDatareader["result"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var linesRead = File.ReadLines(filePath);
|
|
||||||
|
|
||||||
// iterate through each element within the array and
|
|
||||||
// print it out
|
|
||||||
//
|
|
||||||
foreach (var lineRead in linesRead)
|
|
||||||
{
|
|
||||||
if (lineRead == url)
|
|
||||||
{
|
|
||||||
Console.WriteLine("already watched");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void saveIntoFile(string data_input)
|
private static void SaveIntoDatabase(SQLiteConnection conn,int season, int episode)
|
||||||
{
|
{
|
||||||
|
SQLiteCommand sqliteCmd;
|
||||||
//first check if folder and file exist
|
sqliteCmd = conn.CreateCommand();
|
||||||
|
string updateQuery = $"update episodes set seen=1 WHERE season = {season} and episode = {episode}";
|
||||||
if (!Directory.Exists(folder_path))
|
sqliteCmd.CommandText = updateQuery;
|
||||||
Directory.CreateDirectory(folder_path);
|
sqliteCmd.ExecuteNonQuery();
|
||||||
|
|
||||||
using (StreamWriter w = new StreamWriter(filePath, true))
|
|
||||||
{
|
|
||||||
w.WriteLine(data_input);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
string url_generated;
|
string urlGenerated;
|
||||||
|
int randomSeason;
|
||||||
|
int randomEpisode;
|
||||||
|
|
||||||
|
SQLiteConnection sqliteconn;
|
||||||
|
sqliteconn = CreateConnection();
|
||||||
|
|
||||||
|
//check if the old excel exist and convert it to SQLLITE
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
Console.WriteLine("Excel file present");
|
||||||
|
var linesRead = File.ReadLines(filePath);
|
||||||
|
|
||||||
|
foreach (var lineRead in linesRead)
|
||||||
|
{
|
||||||
|
Console.WriteLine(lineRead);
|
||||||
|
string[] words = lineRead.Split('-');
|
||||||
|
int season = Convert.ToInt16(words[3]);
|
||||||
|
int episode = Convert.ToInt16(words[5]);
|
||||||
|
SaveIntoDatabase(sqliteconn,season,episode);
|
||||||
|
Console.WriteLine(season);
|
||||||
|
Console.WriteLine(episode);
|
||||||
|
|
||||||
|
}
|
||||||
|
System.IO.File.Move(filePath,filePath+"_converted.csv");
|
||||||
|
}
|
||||||
|
|
||||||
bool restart = false;
|
bool restart = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
restart = false;
|
restart = false;
|
||||||
|
|
||||||
|
//get maximum number of seasons
|
||||||
|
string maximumNumberOfSeasonsQuery = "SELECT COUNT(DISTINCT season) as result FROM episodes;";
|
||||||
|
int maximumNumberSeasons = Convert.ToInt32(RunSqlQuery(sqliteconn, maximumNumberOfSeasonsQuery));
|
||||||
|
|
||||||
|
|
||||||
int maximum_number_seasons = 35;
|
|
||||||
string root_url = "https://www1.kisscartoon.online/episode/the-simpsons-season-";
|
|
||||||
|
|
||||||
//random for the season
|
//random for the season
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
int random_season = rnd.Next(1, maximum_number_seasons);
|
randomSeason = rnd.Next(1, maximumNumberSeasons);
|
||||||
|
|
||||||
Console.WriteLine("random season:"+random_season);
|
Console.WriteLine("random season: "+randomSeason);
|
||||||
|
|
||||||
|
|
||||||
//dictionary for the maximum number of episodes
|
|
||||||
Dictionary<int, int> Season_nbr_Episodes = new Dictionary<int, int>();
|
|
||||||
Season_nbr_Episodes.Add(1,13);
|
|
||||||
Season_nbr_Episodes.Add(2,22);
|
|
||||||
Season_nbr_Episodes.Add(3,24);
|
|
||||||
Season_nbr_Episodes.Add(4,22);
|
|
||||||
Season_nbr_Episodes.Add(5,22);
|
|
||||||
Season_nbr_Episodes.Add(6,25);
|
|
||||||
Season_nbr_Episodes.Add(7,25);
|
|
||||||
Season_nbr_Episodes.Add(8,25);
|
|
||||||
Season_nbr_Episodes.Add(9,25);
|
|
||||||
Season_nbr_Episodes.Add(10,23);
|
|
||||||
Season_nbr_Episodes.Add(11,22);
|
|
||||||
Season_nbr_Episodes.Add(12,21);
|
|
||||||
Season_nbr_Episodes.Add(13,22);
|
|
||||||
Season_nbr_Episodes.Add(14,22);
|
|
||||||
Season_nbr_Episodes.Add(15,22);
|
|
||||||
Season_nbr_Episodes.Add(16,21);
|
|
||||||
Season_nbr_Episodes.Add(17,22);
|
|
||||||
Season_nbr_Episodes.Add(18,22);
|
|
||||||
Season_nbr_Episodes.Add(19,20);
|
|
||||||
Season_nbr_Episodes.Add(20,21);
|
|
||||||
Season_nbr_Episodes.Add(21,23);
|
|
||||||
Season_nbr_Episodes.Add(22,22);
|
|
||||||
Season_nbr_Episodes.Add(23,22);
|
|
||||||
Season_nbr_Episodes.Add(24,22);
|
|
||||||
Season_nbr_Episodes.Add(25,22);
|
|
||||||
Season_nbr_Episodes.Add(26,22);
|
|
||||||
Season_nbr_Episodes.Add(27,22);
|
|
||||||
Season_nbr_Episodes.Add(28,22);
|
|
||||||
Season_nbr_Episodes.Add(29,21);
|
|
||||||
Season_nbr_Episodes.Add(30,23);
|
|
||||||
Season_nbr_Episodes.Add(31,22);
|
|
||||||
Season_nbr_Episodes.Add(32,22);
|
|
||||||
Season_nbr_Episodes.Add(33,22);
|
|
||||||
Season_nbr_Episodes.Add(34,22);
|
|
||||||
Season_nbr_Episodes.Add(35,18);
|
|
||||||
|
|
||||||
int random_episode = rnd.Next(1,Season_nbr_Episodes[random_season]);
|
|
||||||
|
|
||||||
Console.WriteLine("random episode:"+random_episode);
|
|
||||||
|
|
||||||
|
//get maximum number of episodes for this season
|
||||||
|
string maximumNumberOfEpisodesQuery = $"SELECT COUNT() as result FROM episodes WHERE season = {randomSeason};";
|
||||||
|
int maximumNumberOfEpisodes = Convert.ToInt32(RunSqlQuery(sqliteconn, maximumNumberOfEpisodesQuery));
|
||||||
|
|
||||||
|
randomEpisode = rnd.Next(1, maximumNumberOfEpisodes);
|
||||||
|
Console.WriteLine("random episode: "+randomEpisode);
|
||||||
|
|
||||||
//url generated
|
//url generated
|
||||||
url_generated = root_url + random_season + "-episode-"+random_episode;
|
string urlGeneratedQuery = $"SELECT url as result FROM episodes WHERE season = {randomSeason} and episode = {randomEpisode};";
|
||||||
|
urlGenerated = Convert.ToString(RunSqlQuery(sqliteconn, urlGeneratedQuery));
|
||||||
|
|
||||||
|
|
||||||
|
//CheckEpisodeAlreadyRun
|
||||||
|
string checkEpisodeAlreadyRunQuery = $"SELECT seen as result FROM episodes WHERE season = {randomSeason} and episode = {randomEpisode};";
|
||||||
|
bool checkEpisodeAlreadyRun = Convert.ToBoolean(RunSqlQuery(sqliteconn, checkEpisodeAlreadyRunQuery));
|
||||||
|
|
||||||
Console.WriteLine(url_generated);
|
if (checkEpisodeAlreadyRun)
|
||||||
|
|
||||||
if (CheckEpisodeAlreadyRun(url_generated))
|
|
||||||
{
|
{
|
||||||
//return;
|
//return;
|
||||||
restart = true;
|
restart = true;
|
||||||
@@ -180,11 +203,10 @@ class Program
|
|||||||
|
|
||||||
|
|
||||||
} while (restart);
|
} while (restart);
|
||||||
openit(url_generated);
|
Console.WriteLine("urlGenerated "+urlGenerated);
|
||||||
|
Openit(urlGenerated);
|
||||||
|
|
||||||
saveIntoFile(url_generated);
|
SaveIntoDatabase(sqliteconn,randomSeason,randomEpisode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -8,10 +8,12 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ApplicationIcon>Simpson.ico</ApplicationIcon>
|
<ApplicationIcon>Simpson.ico</ApplicationIcon>
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
|
<PackAsTool>true</PackAsTool>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Simpson.ico" />
|
<Content Include="Simpson.ico" />
|
||||||
|
<PackageReference Include="System.Data.SQLite" Version="1.0.119" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
simpsons_url = "https://www1.kisscartoon.online/episode/the-simpsons-season-";
|
simpsons_url = "https://kisscartoon.top/episode/the-simpsons-season-";
|
||||||
number_of_seasons = 35
|
number_of_seasons = 35
|
||||||
|
|
||||||
seasons_maximum_number = [13,22,24,22,22,25,25,25,25,23,22,21,22,22,22,21,22,22,20,21,23,22,22,22,22,22,22,22,21,23,22,22,22,22,18]
|
seasons_maximum_number = [13,22,24,22,22,25,25,25,25,23,22,21,22,22,22,21,22,22,20,21,23,22,22,22,22,22,22,22,21,23,22,22,22,22,18]
|
||||||
@@ -18,4 +18,4 @@ random_episode = random.randint(1, seasons_maximum_number[random_seasons-1])
|
|||||||
print("random episode: "+ str(random_episode))
|
print("random episode: "+ str(random_episode))
|
||||||
|
|
||||||
final_url = simpsons_url+str(random_seasons)+ "-episode-"+str(random_episode)
|
final_url = simpsons_url+str(random_seasons)+ "-episode-"+str(random_episode)
|
||||||
print(final_url)
|
print(final_url)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NET.ILLink.Tasks": "8.0.8"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-P8wR6MUWwYXIjPJuBaZgo5zlI/GWI6QEAo6NyVIbPefa9CCkohYu7dP2rD/mrqnjEqfRHyl+h9VZrDoGpELqYg==",
|
|
||||||
"path": "microsoft.net.illink.tasks/8.0.8",
|
|
||||||
"hashPath": "microsoft.net.illink.tasks.8.0.8.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NET.ILLink.Tasks": "8.0.8"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-P8wR6MUWwYXIjPJuBaZgo5zlI/GWI6QEAo6NyVIbPefa9CCkohYu7dP2rD/mrqnjEqfRHyl+h9VZrDoGpELqYg==",
|
|
||||||
"path": "microsoft.net.illink.tasks/8.0.8",
|
|
||||||
"hashPath": "microsoft.net.illink.tasks.8.0.8.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0/android-arm64",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {},
|
|
||||||
".NETCoreApp,Version=v8.0/android-arm64": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0/android-arm64",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {},
|
|
||||||
".NETCoreApp,Version=v8.0/android-arm64": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0/linux-x64",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {},
|
|
||||||
".NETCoreApp,Version=v8.0/linux-x64": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0/linux-x64",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {},
|
|
||||||
".NETCoreApp,Version=v8.0/linux-x64": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETCoreApp,Version=v8.0/win-x64",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETCoreApp,Version=v8.0": {},
|
|
||||||
".NETCoreApp,Version=v8.0/win-x64": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NET.ILLink.Tasks": "8.0.8"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"Simpsons_generator.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"Simpsons_generator/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NET.ILLink.Tasks/8.0.8": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-P8wR6MUWwYXIjPJuBaZgo5zlI/GWI6QEAo6NyVIbPefa9CCkohYu7dP2rD/mrqnjEqfRHyl+h9VZrDoGpELqYg==",
|
|
||||||
"path": "microsoft.net.illink.tasks/8.0.8",
|
|
||||||
"hashPath": "microsoft.net.illink.tasks.8.0.8.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeOptions": {
|
|
||||||
"tfm": "net8.0",
|
|
||||||
"framework": {
|
|
||||||
"name": "Microsoft.NETCore.App",
|
|
||||||
"version": "8.0.0"
|
|
||||||
},
|
|
||||||
"configProperties": {
|
|
||||||
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
||||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user