Jump to content

Recommended Posts

Posted

And out of the Anime plugin, which has gotten too big and difficult to understand.

So just an FYI for Anime users.

  • 9 months later...
Posted

Wow super ich habe Ewig auf das Anisearch Plugin gewaret. Für mich als Animefan ein must have.

Jedoch wenn ich mir den Code anschaue muss ich feststellen das es zu einem grossen Teil unnütz und unfertig ist. Und so gar nichts nutzt!

Ich empfehle das Plugin zu überarbeiten.
Ich verstehe gerade nicht warum man das überhaupt released hat? ,Weil im grossen und ganzen macht es nichts.

AniSearchEpisodenProvider.cs

Bericht über den unvollständigen Code und was noch fehlt:

Innerhalb der Methode GetMetadata gibt es eine Schleife, die Informationen über alle Episoden im Bereich zwischen EpisodeNumber und EpisodeNumberEnd sammelt. Obwohl die Schleife die Episodennamen mithilfe eines regulären Ausdrucks extrahiert, werden diese Informationen nicht weiter verarbeitet, da die if- und else-Anweisungen innerhalb der Schleife leer sind.

Empfehlung:  Implementieren der Logik zur Verarbeitung der gesammelten Episodennamen. Dies kann beinhalten, dass Sie die Episodennamen den Episode-Objekten zuweisen und sie zur Ergebnisliste hinzufügen.

 In der Methode GetSearchResults gibt es einen auskommentierten Block von Code, der anscheinend dazu verwendet werden sollte, die AnidbEpisodeIdentity und die AnidbTvdbEpisodeConverter-Klassen zu verwenden, falls keine AniSearch-ID gefunden wird. Diese Logik ist jedoch nicht implementiert.

Empfehlung: Implementieren der Logik, um die auskommentierten Klassen (AnidbEpisodeIdentityProvider und AnidbTvdbEpisodeConverter) zu verwenden, falls keine AniSearch-ID gefunden wird. Dies kann dazu beitragen, die Abdeckung der Episode-Metadaten zu verbessern, indem alternative Quellen verwendet werden.

Die Methode GetImageResponse ist noch nicht implementiert und wirft eine NotImplementedException, wenn sie aufgerufen wird.

Empfehlung:

  • Implementieren der GetImageResponse-Methode, um die Bildinformationen von AniSearch oder einer alternativen Quelle abzurufen.

  • Für die erste Staffel und Filme: Verwenden als Bildquelle seiten wie TheTVDB/Moviedb.

  • Für Typen wie Bonus, OVA, TV-Special, Web und ONA: Verwenden einer alternative Bildquellen, um qualitativ hochwertigere Bilder bereitzustellen. Nutzen des Bild von AniSearch, um ähnliche Bilder in besserer Auflösung auf anderen Plattformen zu suchen, ohne das Originalbild direkt zu verwenden.

AniSearchSeriesProvider.cs

AniSearch Serie Metadata Crawler

Funktionalität: Der aktuelle Code ist in der Lage, Titel und Episodeninformationen aus AniSearch zu extrahieren. Allerdings fehlt die Funktionalität, um die folgenden Informationen zu crawlen:

  •     Die Beschreibung der Serie. Finde gerade das muss ein Musst funkionlaität sein
  •     Haupttitel zusammen mit dem Erscheinungsjahr
  •     Das Erscheinungsjahr separat.
  •     Alle Namen der Serie in verschiedenen Sprachen.
  •     Typ: und Anzahl der Folgen. --> Bei allen Typen ausser Serie und Film muss als Spezial in Emby eingetragen werden mit der Typsesierung
  •     Genres, Studios und Synonyme.
  •     Hauptgenres, Nebengenres und Tags.
  •     Relationen zu anderen Animes, die in Bezug auf die aktuelle Serie stehen, mit Verweisen auf ihre AnimesIDs.

Empfehlung: Um die fehlende Funktionalität zu implementieren, sollten man denentsprechenden Crawler entwickeln, die die oben genannten Informationen aus der AniSearch-Webseite extrahieren.

Posted

Hi, all I really did was move the code out of the Anime plugin and into it's own plugin. I'm not that familiar with AniSearch. Do you want to make some changes and submit a pull request?

Posted (edited)
On 4/14/2023 at 8:19 PM, Luke said:

Hi, all I really did was move the code out of the Anime plugin and into it's own plugin. I'm not that familiar with AniSearch. Do you want to make some changes and submit a pull request?

I see, who is the developer? It would make more sense to work with the person who programmed the plugin?
Also, I don't know how to debug this in Emby, and this is c# i am not familier.

E.g. an example with Javascript node.js

As i said i am not a top dog with c# and while node js has perfect bibliotkenes i am not happy with the htmlpharser

 

const axios = require('axios');
const cheerio = require('cheerio');

async function getAnimeDescription(anisearchId) {
  try {
    const url = `https://www.anisearch.de/anime/${anisearchId}`;
    const response = await axios.get(url);
    const $ = cheerio.load(response.data);

    const description = $('meta[name="description"]').attr('content');

    return description;
  } catch (error) {
    console.error('Error fetching anime description:', error);
    return null;
  }
}

(async () => {
  const anisearchId = 5170; // 07-Ghost anime ID
  const description = await getAnimeDescription(anisearchId);
  console.log('Anime Description:', description);
})();

we use cheerio library for web scraping

In this code example, we use axios to retrieve the web page and cheerio to parse and extract the description from the HTML. The getAnimeDescription function takes the anisearch ID of the anime as an argument and returns the description of the anime.

But in c#

Since the original code, written in C# imust integrate the extraction of the description in C# using HttpClient and HtmlAgilityPack . First, you need to add HtmlAgilityPack to the project as a NuGet package.

using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using HtmlAgilityPack;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Providers;

namespace Emby.Plugins.AniSearch
{
    public class AniSearchEpisodeProvider : IRemoteMetadataProvider<Episode, EpisodeInfo>
    {
        private readonly IServerConfigurationManager _configurationManager;
        private readonly IHttpClient _httpClient;

        public AniSearchEpisodeProvider(IServerConfigurationManager configurationManager, IHttpClient httpClient)
        {
            _configurationManager = configurationManager;
            _httpClient = httpClient;
        }

        public async Task<MetadataResult<Episode>> GetMetadata(EpisodeInfo info, CancellationToken cancellationToken)
        {
            // Existing code...

            string url = "https://www.anisearch.de/anime/" + id + "/episodes";
            string web_content = await api.WebRequestAPI(url);
            
            // Extract the description
            string description = await GetAnimeDescription(url);

            // Existing code...
        }

        // New method for extracting the description
        public async Task<string> GetAnimeDescription(string url)
        {
            var httpClient = new HttpClient();
            var html = await httpClient.GetStringAsync(url);
            var htmlDoc = new HtmlDocument();
            htmlDoc.LoadHtml(html);

            var descriptionNode = htmlDoc.DocumentNode.SelectSingleNode("//meta[@name='description']");
            if (descriptionNode != null)
            {
                return descriptionNode.GetAttributeValue("content", string.Empty);
            }

            return string.Empty;
        }

        // Other existing methods...
    }
}

In this code, I added a new method called GetAnimeDescription that accepts the URL of the anime and extracts the description. Then I integrated this method with the GetMetadata method to get the description.

There is only one example, because I don't understand how the communication with Emby works and how to debug it

Edited by D1sk
Posted
Quote

I see, who is the developer?

The Emby Community :)

  • 4 weeks later...
Posted
On 4/17/2023 at 8:26 PM, Luke said:

The Emby Community :)

Another reason why it is worth developing the ANisearch plugin is the description of the content. The description at anisearch is more thoughtful, wordy and in-depth than Thetvdb and IMDB.
Compare Code Geass
Demons Slayer
Stein;gate
Anisearch has besides the English also the German description. Personally, I am focused on the German. However, the English corresponds to what is written in German.

  • Thanks 1
  • 1 year later...
Wundertat
Posted

to get Genres from series it saves only "Anime" as Genre, nothing else and not as tags.

on metadata manager, genre and tags not locked.

 

2025-02-23 23:38:43.940 Debug App: Running SeriesNfoProvider for /mnt/Anime/Accel World
2025-02-23 23:38:43.946 Debug App: Running AniSearchSeriesProvider for /mnt/Anime/Accel World
2025-02-23 23:38:43.946 Info AniSearch: AniSearch search by aid 7328
2025-02-23 23:38:43.946 Info HttpClient: GET https://www.anisearch.de/anime/7328
2025-02-23 23:38:44.183 Debug Server: http/1.1 GET http://192.168.1.2:8096/emby/System/Logs/embyserver.txt?Sanitize=true&api_key=x_secret1_x. Source Ip: host1, UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
2025-02-23 23:38:44.193 Debug Server: http/1.1 Response 200 to host1. Time: 10ms. GET http://192.168.1.2:8096/emby/System/Logs/embyserver.txt?Sanitize=true&api_key=x_secret1_x
2025-02-23 23:38:44.241 Debug App: Saving nfo metadata for /mnt/Anime/Accel World to /mnt/Anime/Accel World/tvshow.nfo.

tvshow.nfo

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<tvshow>
  <plot />
  <outline />
  <lockdata>false</lockdata>
  <lockedfields>Name|SortName|CommunityRating|CriticRating|Tagline|Overview|OfficialRating|Cast|Studios</lockedfields>
  <dateadded>2020-11-07 22:01:24</dateadded>
  <title>Accel World</title>
  <sorttitle>Accel World</sorttitle>
  <language>de</language>
  <countrycode>DE</countrycode>
  <genre>Anime</genre>
  <uniqueid type="anisearch">7328</uniqueid>
  <anisearchid>7328</anisearchid>
  <episodeguide>{"anisearch":"7328"}</episodeguide>
  <season>-1</season>
  <episode>-1</episode>
  <displayorder>aired</displayorder>
</tvshow>

 

Posted
51 minutes ago, Wundertat said:

to get Genres from series it saves only "Anime" as Genre, nothing else and not as tags.

on metadata manager, genre and tags not locked.

 

2025-02-23 23:38:43.940 Debug App: Running SeriesNfoProvider for /mnt/Anime/Accel World
2025-02-23 23:38:43.946 Debug App: Running AniSearchSeriesProvider for /mnt/Anime/Accel World
2025-02-23 23:38:43.946 Info AniSearch: AniSearch search by aid 7328
2025-02-23 23:38:43.946 Info HttpClient: GET https://www.anisearch.de/anime/7328
2025-02-23 23:38:44.183 Debug Server: http/1.1 GET http://192.168.1.2:8096/emby/System/Logs/embyserver.txt?Sanitize=true&api_key=x_secret1_x. Source Ip: host1, UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
2025-02-23 23:38:44.193 Debug Server: http/1.1 Response 200 to host1. Time: 10ms. GET http://192.168.1.2:8096/emby/System/Logs/embyserver.txt?Sanitize=true&api_key=x_secret1_x
2025-02-23 23:38:44.241 Debug App: Saving nfo metadata for /mnt/Anime/Accel World to /mnt/Anime/Accel World/tvshow.nfo.

tvshow.nfo

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<tvshow>
  <plot />
  <outline />
  <lockdata>false</lockdata>
  <lockedfields>Name|SortName|CommunityRating|CriticRating|Tagline|Overview|OfficialRating|Cast|Studios</lockedfields>
  <dateadded>2020-11-07 22:01:24</dateadded>
  <title>Accel World</title>
  <sorttitle>Accel World</sorttitle>
  <language>de</language>
  <countrycode>DE</countrycode>
  <genre>Anime</genre>
  <uniqueid type="anisearch">7328</uniqueid>
  <anisearchid>7328</anisearchid>
  <episodeguide>{"anisearch":"7328"}</episodeguide>
  <season>-1</season>
  <episode>-1</episode>
  <displayorder>aired</displayorder>
</tvshow>

 

Hi @Wundertatdo you have a question or something that you need help with?

Wundertat
Posted

if you go to url https://www.anisearch.de/anime/7328, you would see there are 15 genres/tags, like action, scifi,...

but Anisearch plugin dont parse this website and set genre only "Anime"

for my self, plugin looks broken

Posted
15 hours ago, Wundertat said:

if you go to url https://www.anisearch.de/anime/7328, you would see there are 15 genres/tags, like action, scifi,...

but Anisearch plugin dont parse this website and set genre only "Anime"

for my self, plugin looks broken

Doesn't the plugin have settings related to this? Have you looked at that?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...