Ricette fatte di richieste, un permesso per richiesta (#36, S3)
Otto ricette (controllo del profilo, storico, taggati, reel, storie di un account, raccolta in evidenza, post singolo, elenco dei seguiti) hanno una strada per richieste dirette accanto a quella con il browser. Ci vanno solo se ogni ruolo che servono è un'operazione configurata di richieste.<sito>.json: con Instagram nessuna lo è e Febe non costruisce il client del sito, quindi il comportamento con Instagram non cambia fino a S4. Ogni richiesta prende il suo permesso dal Governatore nella categoria di ciò che chiede (la prima pagina dei post conta come profilo); i segnali delle risposte vanno all'interruttore e fermano la ricetta prima di ogni altra richiesta. Se manca un valore o la pagina successiva, la ricetta torna alle pagine per quella volta e il motore controlla tutti e due i tetti. I tetti non cambiano: il dimezzamento delle storie viste è tolto perché toccava anche il browser e i «Su misura» salvati, e resta una domanda per Alberto prima di S4. Il simulatore ha --raccolta pagine|richieste con il costo delle operazioni separate di Instagram: sei simulazioni di 30 giorni senza superamenti. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4dcbd0b096
commit
63acae4e73
46 files changed
+3724
-136
No files matched your search
@@ -9,6 +9,7 @@ using Febe.Core.Collection.Diagnostics;
|
||||
using Febe.Core.Collection.Downloads;
|
||||
using Febe.Core.Collection.Readers;
|
||||
using Febe.Core.Collection.Recipes;
|
||||
using Febe.Core.Collection.Requests;
|
||||
using Febe.Core.Collection.Search;
|
||||
using Febe.Core.Domain;
|
||||
using Febe.Core.Engine;
|
||||
@@ -104,8 +105,19 @@ public sealed record CollectionPipelineOptions
|
||||
|
||||
/// <summary>Where the photos of the search results are kept (memory). Null: the search fetches no photo.</summary>
|
||||
public SearchPhotoCache? SearchPhotos { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The site client and its catalog (issue #36, S3): the recipes whose roles are all configured go by requests.
|
||||
/// Null: every recipe goes by the browser. Production leaves it unset until S4.
|
||||
/// </summary>
|
||||
public SiteRequestOptions? Requests { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>The site client of the pipeline and the catalog of its operations (issue #36, S3).</summary>
|
||||
/// <param name="Requester">The site client: one request at a time, each with its permit.</param>
|
||||
/// <param name="Catalog">The operations of <c>richieste.<sito>.json</c> and their roles.</param>
|
||||
public sealed record SiteRequestOptions(ISiteRequester Requester, RequestCatalog Catalog);
|
||||
|
||||
/// <summary>
|
||||
/// The collection pipeline put together (spec §6): response tap, stop signals, readers, page driver, recipe runner and
|
||||
/// download queue, all on one browser page. Disposing it stops listening to the page.
|
||||
@@ -191,6 +203,14 @@ public sealed class CollectionPipeline : IAsyncDisposable
|
||||
Options = options.Recipes,
|
||||
Diagnostics = diagnostics,
|
||||
PageTurns = options.PageTurns,
|
||||
Requests = options.Requests is { } requests
|
||||
? new SiteRequestEnvironment(
|
||||
requests.Requester,
|
||||
requests.Catalog,
|
||||
new SiteAnswerSignals(rules, site.SessionCookie.CookieName),
|
||||
options.Pace,
|
||||
message => options.Log?.Write(BrowserLogLevel.Warning, message))
|
||||
: null,
|
||||
});
|
||||
var fetcher = new BrowserFileFetcher(options.Cdp, site.Hosts, options.Log);
|
||||
var downloads = new DownloadQueue(
|
||||
|
||||
Reference in new issue
Block a user