2025-12-26 16:24:47 +01:00
|
|
|
using System;
|
2025-12-26 18:28:08 +01:00
|
|
|
using System.Collections.Concurrent;
|
2025-12-26 16:24:47 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.Remoting.Messaging;
|
|
|
|
|
using System.Security.Policy;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2025-12-26 20:19:02 +01:00
|
|
|
using A69WD.Service;
|
2025-12-26 16:24:47 +01:00
|
|
|
|
|
|
|
|
namespace A69WD.Net {
|
|
|
|
|
public class cLink_A69 : iLink {
|
|
|
|
|
public static string PageBase { get { return "https://www.annunci69.it"; } }
|
|
|
|
|
public static string LoginPageUrl { get { return "https://www.annunci69.it/accedi.php"; } }
|
|
|
|
|
public static string LoginPostUrl { get { return "https://www.annunci69.it/include/auth/index.php"; } }
|
|
|
|
|
public static string LinkIdxBase { get { return "https://www.annunci69.it/racconti-erotici/racconti_lista.php?genere={Categoria}&pagina={ID}"; } }
|
|
|
|
|
public string[] Categorie { get { return Categorie; } }
|
|
|
|
|
private static readonly string[] categorie = { "altro", "bdsm", "gay", "incesto", "lesbo", "orge", "prime", "scambio", "tradimenti", "trans", "trio" };
|
|
|
|
|
private readonly string filename;
|
|
|
|
|
private readonly string filepath;
|
|
|
|
|
private eLinkState status = eLinkState.ToConfirm;
|
|
|
|
|
private string fields;
|
|
|
|
|
|
|
|
|
|
public string ID => "A69";
|
|
|
|
|
|
|
|
|
|
public string URL { get; }
|
|
|
|
|
|
|
|
|
|
public string FileName => filename;
|
|
|
|
|
|
|
|
|
|
public string FilePath { get => filepath; }
|
|
|
|
|
|
2025-12-27 11:44:02 +01:00
|
|
|
public bool Validate {
|
|
|
|
|
get {
|
|
|
|
|
if (URL.StartsWith("https://www.annunci69.it/racconti-erotici/racconti_lista.php?genere=")) {
|
|
|
|
|
// URL di tipo Idx, devo lavorare i link nuovo o rilavorare i link più obsoleti di 6 ore.
|
|
|
|
|
return !App.DB.IsPresent(URL, -6);
|
|
|
|
|
} else {
|
|
|
|
|
// URL di tipo Rac, devo lavorare solo i link nuovi
|
|
|
|
|
return !App.DB.IsPresent(URL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-26 16:24:47 +01:00
|
|
|
|
|
|
|
|
public eLinkState Status { get => status; set { status = value; } }
|
|
|
|
|
|
|
|
|
|
public string Fields { get => fields; set => fields = value; }
|
|
|
|
|
|
|
|
|
|
public cLink_A69(string Url, string Filename, string fields = "none", string Filepath = "") {
|
|
|
|
|
this.URL = Url;
|
|
|
|
|
this.filename = Filename;
|
|
|
|
|
this.fields = fields;
|
|
|
|
|
this.filepath = string.IsNullOrEmpty(Filepath) ? Cfg.Settings.PathDownloadWorking : Filepath;
|
|
|
|
|
this.status = eLinkState.ToConfirm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-12-26 18:28:08 +01:00
|
|
|
|
|
|
|
|
public static List<iLink> GetStartLink() {
|
|
|
|
|
List<iLink> links = new List<iLink>();
|
|
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
|
|
foreach (string cat in categorie) {
|
|
|
|
|
string url = LinkIdxBase.Replace("{Categoria}", cat).Replace("{ID}", i.ToString());
|
|
|
|
|
string name = string.Format("_A69_{0}_{1}.html", cat, i.ToString());
|
|
|
|
|
links.Add(new cLink_A69(url, name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return links;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool InsertStartLink(BlockingCollection<iLink> _urlQueue) {
|
|
|
|
|
int i = 1;
|
|
|
|
|
try {
|
|
|
|
|
foreach (string cat in categorie) {
|
|
|
|
|
string url = LinkIdxBase.Replace("{Categoria}", cat).Replace("{ID}", i.ToString());
|
|
|
|
|
string name = string.Format("_A69_{0}_{1}.html", cat, i.ToString("0000"));
|
|
|
|
|
_urlQueue.Add(new cLink_A69(url, name));
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
Logger.Error("Errore inserendo A69 Start Link - " + ex.Message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-26 20:19:02 +01:00
|
|
|
|
2025-12-26 18:28:08 +01:00
|
|
|
|
2025-12-26 20:19:02 +01:00
|
|
|
public static bool InsertStartLink(Service_Crawler service) {
|
2025-12-27 12:28:13 +01:00
|
|
|
//string url = LinkIdxBase.Replace("{Categoria}", "altro").Replace("{ID}", "1"); //LinkIdxBase.Replace("{Categoria}", "trio").Replace("{ID}", "1");
|
|
|
|
|
//string name = "_A69_altro_0001.html"; //"_A69_trio_0001.html";
|
|
|
|
|
//service.EnqueueUrl(new cLink_A69(url, name));
|
|
|
|
|
//return true;
|
|
|
|
|
int i = 1;
|
|
|
|
|
try {
|
|
|
|
|
foreach (string cat in categorie) {
|
|
|
|
|
string url = LinkIdxBase.Replace("{Categoria}", cat).Replace("{ID}", i.ToString());
|
|
|
|
|
string name = string.Format("_A69_{0}_{1}.html", cat, i.ToString("0000"));
|
|
|
|
|
service.EnqueueUrl(new cLink_A69(url, name));
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
Logger.Error("Errore inserendo A69 Start Link - " + ex.Message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2025-12-26 20:19:02 +01:00
|
|
|
}
|
2025-12-26 18:28:08 +01:00
|
|
|
|
2025-12-26 16:24:47 +01:00
|
|
|
}//class cLink_A69
|
|
|
|
|
|
|
|
|
|
}//namespace A69WD.Net
|
|
|
|
|
|