Skip to content

Commit

Permalink
fix(nubiles): Account for alternative poster source (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tob-Knob authored Dec 22, 2023
1 parent 6d9baa6 commit 9f7ef21
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://paypal.me/dirtyracer']
custom: #
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, Cancell
#endif
{
IEnumerable<RemoteImageInfo> images = new List<RemoteImageInfo>();

if (item == null)
{
return images;
Expand Down
38 changes: 28 additions & 10 deletions Jellyfin.Plugin.PhoenixAdult/Sites/NetworkNubiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,33 +158,51 @@ public async Task<IEnumerable<RemoteImageInfo>> GetImages(int[] siteNum, string[
}

var sceneURL = Helper.Decode(sceneID[0]);
Logger.Debug($"SceneURL: {sceneURL}");
if (!sceneURL.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
sceneURL = Helper.GetSearchBaseURL(siteNum) + sceneURL;
}

var sceneData = await HTML.ElementFromURL(sceneURL, cancellationToken).ConfigureAwait(false);

var poster = sceneData.SelectSingleText("//video/@poster");
if (!string.IsNullOrEmpty(poster))
var photoLink = sceneData.SelectNodesSafe("//a[i[@class='icon-camera']]")[0];
var photoPageURL = $"https://nubiles-porn.com{photoLink.Attributes["href"].Value}";
Logger.Debug($"Getting posters: {photoPageURL}");
var photoPage = await HTML.ElementFromURL(photoPageURL, cancellationToken).ConfigureAwait(false);
var sceneImages = photoPage.SelectNodesSafe("//div[@class='img-wrapper']//source[1]");
foreach (var sceneImage in sceneImages)
{
var posterURL = sceneImage.Attributes["src"]?.Value;
if (string.IsNullOrEmpty(posterURL))
{
posterURL = sceneImage.Attributes["srcset"].Value;
}

Logger.Debug($"Found poster: {posterURL}");
result.Add(new RemoteImageInfo
{
Url = poster,
Url = $"https:{posterURL}",
Type = ImageType.Backdrop,
});
result.Add(new RemoteImageInfo
{
Url = $"https:{posterURL}",
Type = ImageType.Primary,
});
}

var photoPageURL = "https://nubiles-porn.com/photo/gallery/" + sceneID[0];
var photoPage = await HTML.ElementFromURL(photoPageURL, cancellationToken).ConfigureAwait(false);
var sceneImages = photoPage.SelectNodesSafe("//div[@class='img-wrapper']//source[1]");
foreach (var sceneImage in sceneImages)
var poster = sceneData.SelectSingleText("//video/@poster");
if (!string.IsNullOrEmpty(poster))
{
var posterURL = sceneImage.Attributes["src"].Value;

result.Add(new RemoteImageInfo
{
Url = posterURL,
Url = poster,
Type = ImageType.Primary,
});
result.Add(new RemoteImageInfo
{
Url = poster,
Type = ImageType.Backdrop,
});
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"guid": "8f97371f-8617-463c-9859-a33072182494",
"name": "PhoenixAdult",
"description": "This metadata provider helps fill Jellyfin/Emby with information for your adult videos by pulling from the original site.",
"owner": "DirtyRacer",
"owner": "Tob-Knob",
"overview": "Manage Your Adult Videos in Jellyfin/Emby",
"versions": [
{
Expand Down

0 comments on commit 9f7ef21

Please sign in to comment.