Refactor downloaders to use generic options and unify logic

Replaces specialized binary and HTML downloaders with a generic, options-driven UnitDownloader and UnitFragmentDownloader pattern. Introduces UnitDownloaderOptions and builder classes for flexible configuration, updates interfaces and method signatures to support progress reporting, and removes redundant binary-specific classes. Updates Playwright and Stealth downloaders to use the new generic base, and adds improved error handling and reporting. Also updates dependency versions and makes minor API consistency improvements across the Fluent and Models layers.
This commit is contained in:
qwsdcvghyu89
2025-09-29 21:27:56 +10:00
parent 8e60109f5e
commit 2958a26e4f
30 changed files with 621 additions and 422 deletions
+8 -7
View File
@@ -7,11 +7,12 @@
<Title>Beam</Title>
<Authors>aeqw89</Authors>
<Company>qwsdcvghyu</Company>
<Version>2.1.6</Version>
<Version>2.2.0</Version>
<Description>A library for downloading internet resources</Description>
<PackageProjectUrl>https://github.com/qwsdcvghyu89/Beam</PackageProjectUrl>
<RepositoryUrl>https://github.com/qwsdcvghyu89/Beam</RepositoryUrl>
<PackageId>aeqw89.Beam</PackageId>
<PackageVersion>2.2.0</PackageVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Beam.Dynamic\Beam.Dynamic.csproj">
@@ -32,7 +33,7 @@
<ProjectReference Include="..\Beam\Beam.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<PackageReference Include="aeqw89.DataKeys" Version="2.0.1">
<PackageReference Include="aeqw89.DataKeys" Version="2.1.1">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="aeqw89.PersistentData" Version="1.4.5">
@@ -53,7 +54,7 @@
<PackageReference Include="Selenium.WebDriver" Version="4.34.0">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="System.Linq.Async" Version="6.0.1">
<PackageReference Include="System.Linq.Async" Version="6.0.3">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="EntityFramework" Version="6.5.1">
@@ -101,10 +102,10 @@
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Temporary.Cli\bin\$(Configuration)\$(TargetFramework)\HtmlAgilityPack.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<!-- <Content Include="..\Beam.Temporary.Cli\bin\$(Configuration)\$(TargetFramework)\HtmlAgilityPack.dll">-->
<!-- <PackagePath>lib\$(TargetFramework)\</PackagePath>-->
<!-- <Pack>true</Pack>-->
<!-- </Content>-->
<Content Include="..\Beam.Api\bin\$(Configuration)\$(TargetFramework)\Beam.Api.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
+130
View File
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>Beam</Title>
<Authors>aeqw89</Authors>
<Company>qwsdcvghyu</Company>
<Version>2.1.6</Version>
<Description>A library for downloading internet resources</Description>
<PackageProjectUrl>https://github.com/qwsdcvghyu89/Beam</PackageProjectUrl>
<RepositoryUrl>https://github.com/qwsdcvghyu89/Beam</RepositoryUrl>
<PackageId>aeqw89.Beam</PackageId>
<PackageVersion>2.1.6</PackageVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Beam.Dynamic\Beam.Dynamic.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\Beam.Exports\Beam.Exports.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\Beam.Playwright\Beam.Playwright.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\Beam.Stealth\Beam.Stealth.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<!-- <ProjectReference Include="..\Beam.Temporary.Cli\Beam.Temporary.Cli.csproj">-->
<!-- <PrivateAssets>all</PrivateAssets>-->
<!-- </ProjectReference>-->
<ProjectReference Include="..\Beam\Beam.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<PackageReference Include="aeqw89.DataKeys" Version="2.1.1">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="aeqw89.PersistentData" Version="1.4.5">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="HtmlAgilityPack" Version="1.11.72">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Microsoft.Recognizers.Text.Number" Version="1.8.13">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Microsoft.Playwright" Version="1.52.0">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Selenium.WebDriver" Version="4.34.0">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="System.Linq.Async" Version="6.0.1">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="EntityFramework" Version="6.5.1">
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<Transitive>true</Transitive>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<Transitive>true</Transitive>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\Beam\bin\$(Configuration)\$(TargetFramework)\Beam.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Dynamic\bin\$(Configuration)\$(TargetFramework)\Beam.Dynamic.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Exports\bin\$(Configuration)\$(TargetFramework)\Beam.Exports.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Playwright\bin\$(Configuration)\$(TargetFramework)\Beam.Playwright.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Stealth\bin\$(Configuration)\$(TargetFramework)\Beam.Stealth.dll">
<PackagePath>lib\$(TargetFramework)\</PackagePath>
<Pack>true</Pack>
</Content>
<!-- <Content Include="..\Beam.Temporary.Cli\bin\$(Configuration)\$(TargetFramework)\Beam.Temporary.Cli.dll">-->
<!-- <PackagePath>lib\$(TargetFramework)\</PackagePath>-->
<!-- <Pack>true</Pack>-->
<!-- </Content>-->
<Content Include="..\Beam.Fluent\bin\$(Configuration)\$(TargetFramework)\Beam.Fluent.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Models\bin\$(Configuration)\$(TargetFramework)\Beam.Models.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<!-- <Content Include="..\Beam.Temporary.Cli\bin\$(Configuration)\$(TargetFramework)\HtmlAgilityPack.dll">-->
<!-- <PackagePath>lib\$(TargetFramework)\</PackagePath>-->
<!-- <Pack>true</Pack>-->
<!-- </Content>-->
<Content Include="..\Beam.Api\bin\$(Configuration)\$(TargetFramework)\Beam.Api.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Data\bin\$(Configuration)\$(TargetFramework)\Beam.Data.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Abstractions\bin\$(Configuration)\$(TargetFramework)\Beam.Abstractions.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Downloaders\bin\$(Configuration)\$(TargetFramework)\Beam.Downloaders.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
<Content Include="..\Beam.Exceptions\bin\$(Configuration)\$(TargetFramework)\Beam.Exceptions.dll">
<PackagePath>lib\$(TargetFramework)</PackagePath>
<Pack>true</Pack>
</Content>
</ItemGroup>
</Project>