This commit is contained in:
limil 2025-04-19 12:21:13 +08:00
commit bb9ea8d059
5 changed files with 198 additions and 0 deletions

135
.gitignore vendored Normal file
View File

@ -0,0 +1,135 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.svclog
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
*.azurePubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/
## TODO: If the tool you use requires repositories.config, also uncomment the next line
!packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
![Ss]tyle[Cc]op.targets
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
_NCrunch*
.idea

16
BangumiRenamer.sln Normal file
View File

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BangumiRenamer", "BangumiRenamer\BangumiRenamer.csproj", "{46889D6D-165B-4984-A4A6-D2589EE3BE27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{46889D6D-165B-4984-A4A6-D2589EE3BE27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46889D6D-165B-4984-A4A6-D2589EE3BE27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46889D6D-165B-4984-A4A6-D2589EE3BE27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46889D6D-165B-4984-A4A6-D2589EE3BE27}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RestSharp" Version="112.1.0" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
using BangumiRenamer;
var workspace = "C:/Users/15401/Proj/BangumiRenamer/PlayGround";
Directory.SetCurrentDirectory(workspace);
var tmdbHelper = new TMDbHelper();
await tmdbHelper.SendRequest();

View File

@ -0,0 +1,26 @@
using System.Net;
using RestSharp;
namespace BangumiRenamer;
public class TMDbHelper
{
private const string URL = "https://api.themoviedb.org/3/authentication";
private const string APIKEY = "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5OTExMDdhZjI1OTEzNTYyY2ZhMDY2MjJhNTI4NzNlMSIsIm5iZiI6MTcyMjY1MzY4My4xNjUsInN1YiI6IjY2YWQ5YmYzNTYzOGJjYmZmMWMwNWUzNiIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.BWFxLMJoAPl3wXNi_Gszx97WIPhbca3K33ASwjx_EPk";
public async Task SendRequest()
{
var options = new RestClientOptions(URL)
{
Proxy = new WebProxy("http://127.0.0.1:7897")
};
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddHeader("Authorization",$"Bearer {APIKEY}");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
}
}