Skip to content

Commit

Permalink
Updated JavTrailersClient, Updated Manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiyanShivvy committed Apr 15, 2024
1 parent c525c6a commit 8ff32bd
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 100 deletions.
Binary file modified .vs/JellyfinJAV/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/JellyfinJAV/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/JellyfinJAV/v17/.suo
Binary file not shown.
92 changes: 12 additions & 80 deletions .vs/JellyfinJAV/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,13 @@
"Version": 1,
"WorkspaceRootPath": "W:\\Dev\\Repos\\JellyfinJAV\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|w:\\dev\\repos\\jellyfinjav\\tests\\asianscreensclienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|solutionrelative:tests\\asianscreensclienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|w:\\dev\\repos\\jellyfinjav\\tests\\tests.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|solutionrelative:tests\\tests.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
},
{
"AbsoluteMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|w:\\dev\\repos\\jellyfinjav\\tests\\r18clienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|solutionrelative:tests\\r18clienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|w:\\dev\\repos\\jellyfinjav\\jellyfinjav\\providers\\r18\\r18provider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|solutionrelative:jellyfinjav\\providers\\r18\\r18provider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|w:\\dev\\repos\\jellyfinjav\\jellyfinjav\\api\\javtrailersclient.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|solutionrelative:jellyfinjav\\api\\javtrailersclient.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|w:\\dev\\repos\\jellyfinjav\\jellyfinjav\\api\\r18client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{9C935854-2F75-4924-A165-305947383DE5}|JellyfinJav\\JellyfinJav.csproj|solutionrelative:jellyfinjav\\api\\r18client.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
"AbsoluteMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|w:\\dev\\repos\\jellyfinjav\\tests\\javtrailersclienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{0B5322E5-53C7-4D33-B404-593FB1418881}|Tests\\Tests.csproj|solutionrelative:tests\\javtrailersclienttest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
Expand All @@ -34,88 +18,36 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 4,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Tests",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\Tests.csproj",
"RelativeDocumentMoniker": "Tests\\Tests.csproj",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\Tests.csproj",
"RelativeToolTip": "Tests\\Tests.csproj",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2024-04-15T16:51:01.165Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "R18ClientTest.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\R18ClientTest.cs",
"RelativeDocumentMoniker": "Tests\\R18ClientTest.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\R18ClientTest.cs",
"RelativeToolTip": "Tests\\R18ClientTest.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAoAAAACAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-15T16:50:30.005Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "R18Provider.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Providers\\R18\\R18Provider.cs",
"RelativeDocumentMoniker": "JellyfinJav\\Providers\\R18\\R18Provider.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Providers\\R18\\R18Provider.cs",
"RelativeToolTip": "JellyfinJav\\Providers\\R18\\R18Provider.cs",
"ViewState": "AQIAAFIAAAAAAAAAAAAvwGYAAAA/AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-15T16:50:01.02Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "AsianscreensClientTest.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\AsianscreensClientTest.cs",
"RelativeDocumentMoniker": "Tests\\AsianscreensClientTest.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\AsianscreensClientTest.cs",
"RelativeToolTip": "Tests\\AsianscreensClientTest.cs",
"ViewState": "AQIAADEAAAAAAAAAAAAwwEUAAAAwAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-15T16:47:43.445Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "JavtrailersClient.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Api\\JavtrailersClient.cs",
"RelativeDocumentMoniker": "JellyfinJav\\Api\\JavtrailersClient.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Api\\JavtrailersClient.cs",
"RelativeToolTip": "JellyfinJav\\Api\\JavtrailersClient.cs",
"ViewState": "AQIAAIgAAAAAAAAAAAAwwI8AAAAMAAAA",
"ViewState": "AQIAAEkAAAAAAAAAAAAkwGMAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-15T16:44:52.277Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "R18Client.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Api\\R18Client.cs",
"RelativeDocumentMoniker": "JellyfinJav\\Api\\R18Client.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\JellyfinJav\\Api\\R18Client.cs",
"RelativeToolTip": "JellyfinJav\\Api\\R18Client.cs",
"ViewState": "AQIAAHwAAAAAAAAAAAAAAGQAAAAzAAAA",
"DocumentIndex": 1,
"Title": "JavtrailersClientTest.cs",
"DocumentMoniker": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\JavtrailersClientTest.cs",
"RelativeDocumentMoniker": "Tests\\JavtrailersClientTest.cs",
"ToolTip": "W:\\Dev\\Repos\\JellyfinJAV\\Tests\\JavtrailersClientTest.cs",
"RelativeToolTip": "Tests\\JavtrailersClientTest.cs",
"ViewState": "AQIAACIAAAAAAAAAAAAiwDEAAAAkAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-15T16:44:15.428Z",
"WhenOpened": "2024-04-15T17:45:54.964Z",
"EditorCaption": ""
}
]
Expand Down
Binary file removed .vs/JellyfinJAV/v17/TestStore/0/002.testlog
Binary file not shown.
Binary file added .vs/JellyfinJAV/v17/TestStore/0/018.testlog
Binary file not shown.
Binary file modified .vs/JellyfinJAV/v17/TestStore/0/testlog.manifest
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/jellyfinjav.metadata.v8.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/jellyfinjav.projects.v8.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/jellyfinjav.strings.v8.bin
Binary file not shown.
42 changes: 26 additions & 16 deletions JellyfinJav/Api/JavtrailersClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace JellyfinJav.Api
using AngleSharp.Dom;
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using MediaBrowser.Controller.Entities;
using Microsoft.Extensions.Logging;
using static System.Net.Mime.MediaTypeNames;

Expand Down Expand Up @@ -65,30 +66,39 @@ public static async Task<IEnumerable<VideoResult>> Search(string identifier)
/// <returns>The first result of the search, or null if nothing was found.</returns>
public static async Task<Video?> SearchFirst(string code)
{
var config = Configuration.Default.WithDefaultLoader();
var context = BrowsingContext.New(config);
var doc = await context.OpenAsync($"https://javtrailers.com/search/{code}");

var h3Element = doc.QuerySelector("h3");
var firstEntry = doc.QuerySelector(".card-container");

if (firstEntry != null)
var santizedSearch = code.Replace("-", string.Empty);
var config = Configuration.Default.WithDefaultLoader();
var context = BrowsingContext.New(config);
var doc = await context.OpenAsync($"https://javtrailers.com/search/{santizedSearch}");
var h3Element = doc.QuerySelector("h3");
var matchedEntry = string.Empty;

foreach (var n in doc.QuerySelectorAll(".card-container"))
{
return await LoadVideo(new Uri("https://javtrailers.com" + firstEntry.QuerySelector("a").GetAttribute("href"))).ConfigureAwait(false);

// var test = await LoadVideo(firstEntry.QuerySelector("a").GetAttribute("href"));
// return new Video(code: test.ToString(), id: "It should load the video to parse", title: firstEntry.QuerySelector("a").GetAttribute("href"), actresses: new List<string>(), genres: new List<string>(), studio: string.Empty, boxArt: string.Empty, cover: string.Empty, releaseDate: null);
var id = n.QuerySelector("a").GetAttribute("href");
var imgAlt = n.QuerySelector("img").GetAttribute("alt").Replace(" jav", string.Empty).Replace("-", string.Empty);
if (id.Contains(santizedSearch) || imgAlt == santizedSearch)
{
matchedEntry = id;
}
}
else if (h3Element != null && h3Element.TextContent.Contains("No videos"))

if (h3Element != null && h3Element.TextContent.Contains("No videos"))
{
return null;

// return new Video(id: "No Videos", code: doc.ToHtml(), title: string.Empty, actresses: new List<string>(), genres: new List<string>(), studio: string.Empty, boxArt: string.Empty, cover: string.Empty, releaseDate: null);
// return new Video(id: $"I'm Looking for: {code} {santizedSearch}", code: $"But I got mE: {matchedEntry!} h3: {h3Element.TextContent}", title: doc.ToHtml(), actresses: new List<string>(), genres: new List<string>(), studio: string.Empty, boxArt: string.Empty, cover: string.Empty, releaseDate: null);
}
else

if (matchedEntry.Contains("/video/"))
{
return null;
// return await LoadVideo(new Uri("https://javtrailers.com" + matchedEntry)).ConfigureAwait(false);
return new Video(id: $"I'm Looking for: {code} {santizedSearch}", code: $"But I got {matchedEntry!} {h3Element}", title: doc.ToHtml(), actresses: new List<string>(), genres: new List<string>(), studio: string.Empty, boxArt: string.Empty, cover: string.Empty, releaseDate: null);
}

return null;

// return new Video(id: $"I'm gonna Look for: {code}", code: $"But I got {matchedEntry!}", title: doc.ToHtml(), actresses: new List<string>(), genres: new List<string>(), studio: string.Empty, boxArt: string.Empty, cover: string.Empty, releaseDate: null);
}

/// <summary>Loads a specific JAV by id.</summary>
Expand Down
4 changes: 2 additions & 2 deletions JellyfinJav/JellyfinJav.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>net50</TargetFramework>
<AssemblyVersion>2024.04.16.1</AssemblyVersion>
<FileVersion>2024.04.16.1</FileVersion>
<AssemblyVersion>2024.04.16.2</AssemblyVersion>
<FileVersion>2024.04.16.2</FileVersion>
<NoWarn>SA1633</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions Tests/JavtrailersClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public async Task TestSearchFirstInvalid()
[Test]
public async Task TestSearchFirstSingleResult()
{
var result = await JavtrailersClient.SearchFirst("SSNI-230").ConfigureAwait(false);
var result = await JavtrailersClient.SearchFirst("HODV-21840").ConfigureAwait(false);

var correct = new Video(
id: "javli7bvzi",
code: "SSNI-230",
code: "HODV-21840",
title: "Big Slap Brilliantly Seductive Ass Pub Miss",
actresses: new[] { "Hoshino Nami" },
genres: new[] { "Solowork", "Nasty, Hardcore", "Cowgirl", "Prostitutes", "Butt", "Risky Mosaic", "Huge Butt" },
Expand Down
8 changes: 8 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"owner": "kyuhaku (current), imaginary-upside (former)",
"overview": "JAV metadata providers for Jellyfin.",
"versions": [
{
"checksum": "2f9d6ec5119f50706f9c0b689d30a7a5",
"changelog": "",
"targetAbi": "10.7.1.0",
"sourceUrl": "https://github.com/Kyuhaku/JellyfinJAV/releases/download/2024.04.16.2/jellyfinjav_2024.04.16.2.zip",
"timestamp": "2024-04-16T06:42:01Z",
"version": "2024.04.16.2"
},
{
"checksum": "bfa2f82073dd91d6f011ec3a3d65bb86",
"changelog": "",
Expand Down

0 comments on commit 8ff32bd

Please sign in to comment.