Beiträge von pdeg69

    German URL ( searchurl="http://german.imdb.com/find?s=tt&q=" ) doesn't work anymore. Just tried it and result is "no data found". Let's hope the author or someone else will fix it. Unfortunately, I can't. Perhaps the next Gen2VDR V3 will have XBMC integration. That would also solve this issue :arme

    With imdb-search.sh in attachement I get results. However, I've never seen images and IMDB rating is missing. Cheers, Peter


    Hmm, get an error when I try to save the attachement. Here is the code:



    #!/bin/bash
    # Version 0.0.6a
    # Date: 2007-09-18
    #-------------------
    #änderbare Variablen
    #-------------------
    DEBUG=true
    svdrp="svdrpsend.pl"
    commandNo=7
    cachefolder="/tmp/.imdb-cache"
    #------------------------
    #nur im notfall verändern
    #------------------------
    searchurl="http://us.imdb.com/find?s=tt&q="
    tempout="/tmp/htmlout"
    moviedata="/tmp/moviedata"
    img="/tmp/img.jpg"
    #------------------
    #keinesfalls ändern
    #------------------
    PLUGINCALL=0
    CMDCONFCALL=1
    RECCMDCONFCALL=2
    PLUGINCALLLIVE=3
    MPLAYER=false
    GETIMAGE=true



    function getHTML()
    {
    #Suche ausführen
    lynx -dump -width=500 "$searchurl$1" > $tempout
    tmpurl=$(grep -e 'http:\/\/us.imdb.com\/title\/tt[0-9]*\/' $tempout | head -1 | cut -d"." -f2-)
    #direkt bei der Suche zum eindeutigen Ergebnis weitergeleitet oder nicht?
    if [ "$(grep 'Overview' $tempout)" != "" ]
    #ja
    then
    titleurl=$searchurl$1
    if $DEBUG
    then
    echo "[imdb-search] $1 ergab einen eindeutigen Treffer: $titleurl"
    fi;
    #nein
    #hat die Suche wenigstens Treffer ergeben?
    elif [ "$tmpurl" != "" ]
    #ja
    then
    #Exact Match?
    if [ "$(grep 'Exact Matches' $tempout)" != "" ]
    #ja
    then
    #finde link von dem ersten exact match
    link=$(awk '/Exact Matches/,/^$/' $tempout | grep -e '\[[0-9]*\][^\[]' | head -1 | cut -d"]" -f1 | cut -d"[" -f2).
    exactmatchurl=$(grep `echo $link`' http' $tempout | head -1 | awk '{print $2}')
    if $DEBUG
    then
    echo "[imdb-search] $1 ergab einen 'Exact Match' Treffer: $exactmatchurl"
    fi;
    fi;
    #Popular match?
    if [ "$(grep 'Popular Titles' $tempout)" != "" ]
    #ja
    then
    populartitleurl=$tmpurl
    if $DEBUG
    then
    echo "[imdb-search] $1 ergab einen 'Popular Title' Treffer: $populartitleurl"
    fi;
    #nein
    else
    bestresulturl=$tmpurl
    if $DEBUG
    then
    echo "[imdb-search] $1 ergab einen 'Approx|Partial Match' Treffer: $bestresulturl"
    fi;
    fi;
    #nein
    else
    if $DEBUG
    then
    echo "[imdb-search] $1 ergab keinen Treffer"
    fi;
    fi;
    }



    #anhand des/der Parameter überprüfen woher der Aufruf kam und $title festlegen
    if [ $# -ge 1 ]
    #Parameter gegeben => PLUGINCALL oder RECCMDCONFCALL
    then
    #RECCMCONFCALL oder PLUGINCALL bei dvb-wiedergabe?
    if [ "$(echo $1 | grep '/video')" != "" ]
    #ja
    then
    #RECCMDCONFCALL?
    if [ "$2" = "" ]
    #ja
    then
    DEBUG=false
    calltype=$RECCMDCONFCALL
    #nein
    else
    calltype=$PLUGINCALL
    fi;
    title="$(grep -e '^T.*' $1/info.vdr | head -1 | cut -d' ' -f2- | tr ' ' '+')"
    #nein => PLUGINCALL
    else
    if [ "$2" = "VDRPLUGIN_LIVE" ]
    then
    calltype=$PLUGINCALLLIVE
    elif [ "$2" = "VDRPLUGIN_LIVE_NOIMG" ]
    then
    calltype=$PLUGINCALLLIVE
    GETIMAGE=false
    elif [ "$2" = "VDRPLUGIN" ]
    then
    calltype=$PLUGINCALL
    elif [ "$2" = "VDRPLUGIN_NOIMG" ]
    then
    calltype=$PLUGINCALL
    GETIMAGE=false
    fi;
    for arg in $*
    do
    if [ "$arg" != "VDRPLUGIN" ] && [ "$arg" != "VDRPLUGIN_LIVE" ] && [ "$arg" != "VDRPLUGIN_NOIMG" ] && [ "$arg" != "VDRPLUGIN_LIVE_NOIMG" ]
    then
    if [ "$title" != "" ]
    then
    title="$title+$arg"
    else
    title="$arg"
    fi;
    fi;
    done
    fi;
    #kein Parameter gegeben => CMDCONFCALL
    else
    calltype=$CMDCONFCALL
    channel=$($svdrp chan | grep 250 | cut -d" " -f 2)
    title=$($svdrp lste $channel now | grep 215-T | cut -d" " -f 2-| tr ' ' '+')
    fi;


    if $DEBUG
    then
    echo "[imdb-search] $calltype: Suche nach $title"
    fi;


    #wenn aber mplayer läuft, alles über den haufen werfen...
    mptitle=$(ps ax | #alle Prozesse
    grep mplayer.sh | #die mplayer.sh enthalten
    grep -v grep | #ausser dem grep aufruf selbst natürlich
    sed 's/^.*mplayer.sh//; #entferne alles vor dem mplayer.sh-parameter
    s/\"[^\"]*$//; #entferne alles hinter dem mplayer.sh-parameter
    s/\"//g; #etwaige " entfernen
    s/"//g;
    s/\/.*\///; #entferne im Parameter den Pfad
    s/[^\.]*$//; #entferne Dateiendung
    s/dvdrip.*//I; #entferne mögliche zusätzliche Informationen hinter dem Titel
    s/ac3.*//I;
    s/mp3.*//I;
    s/s[0-9][0-9]*e[0-9][0-9]*.*//I;#;)
    s/\[[^]]*\]//g; #[123]456[123]789=>456789
    s/ /+/g; #bau den title zusammen
    s/_/+/g;
    s/\./+/g #das dürfte alles gewesen sein
    ')


    if [ "$mptitle" != "" ] && [ $calltype != $RECCMDCONFCALL ] && [ $calltype != $PLUGINCALLLIVE ]
    then
    if $DEBUG
    then
    echo "[imdb-search] mplayer läuft=>Suche doch nicht nach $title, sondern nach $mptitle"
    fi;
    MPLAYER=true
    title=$mptitle
    fi;



    # titel aufräumen
    title=$(echo $title | sed 's/\#//')


    #Verschiedene Titel zum probieren
    #Kompletter Titel - Titel vor der Klammer (falls vorhanden) - Titel in der Klammer (falls vorhanden)(Originaltitel?)
    titles="$title $(echo "$title" | grep '(' | cut -d"(" -f 1) $(echo "$title" | grep '(' | cut -d"(" -f2 | cut -d")" -f1 | tr ')' ' ') "


    #Titel im cache?
    if [ -s $cachefolder/$title.info ]
    #ja
    then
    if $DEBUG
    then
    echo "[imdb-search] $title im cache gefunden"
    fi
    cp $cachefolder/$title.info $moviedata
    if [ -s $cachefolder/$title.jpg ]
    then
    cp $cachefolder/$title.jpg $img
    fi;
    #nein
    else
    #get HTML
    for try in $titles
    do
    getHTML $try;
    if [ "$titleurl" != "" ]
    then
    break
    fi;
    done


    if $DEBUG
    then
    echo "[imdb-search] Suchergebnisse:"
    echo "[imdb-search] titleurl: $titleurl"
    echo "[imdb-search] exactmatchurl: $exactmatchurl"
    echo "[imdb-search] populartitleurl: $populartitleurl"
    echo "[imdb-search] bestresulturl: $bestresulturl"
    fi;


    #kein direkter Treffer, also weiterschauen
    if [ "$titleurl" = "" ]
    then
    #exakt?
    if [ "$populartitleurl" != "" ]
    then
    result=$populartitleurl
    #popular?
    elif [ "$exactmatchurl" != "" ]
    then
    result=$exactmatchurl
    #approx|partial?
    elif [ "$bestresulturl" != "" ]
    then
    result=$(echo $bestresulturl | sed 's/LYNXIMGMAP://')
    result=$(echo $bestresulturl | sed 's/sales//')
    #nix?
    else
    if [ calltype = $RECCMDCONFCALL ] || [ calltype = $CMDCONFCALL ]
    then
    dummy=$($svdrpsend mesg "Kein IMDb-Eintrag gefunden!")
    fi;
    exit 1
    fi;
    else
    result=$titleurl
    fi;
    if $DEBUG
    then
    echo "[imdb-search] Ergebnis: $result"
    fi;


    lynx -dump -image-links -width=500 "$result" > $tempout



    #hole filmposter
    imgurl=$(cat $tempout | grep 'http://ia.imdb.com/media' | head -1 | cut -d"." -f2-)
    if [ "$(echo $imgurl | grep 'jpg' )" != "" ]
    then
    wget -O $img $imgurl >/dev/null 2>&1
    cp $img $cachefolder/$title.jpg
    fi




    #Formatiere die Daten
    >$moviedata
    echo "Titel: '$(grep 'IMDb >' $tempout | head -1 | cut -d">" -f2-)'" >> $moviedata
    echo >> $moviedata
    grep 'Nutzer-Bewertung' $tempout | head -1 | sed -e 's/\[[0-9a-zA-Z\.]*\]//g' >> $moviedata
    awk '/^(Regisseur|Director|Season)/,/.*(Diskussionsforen|Message Boards).*/' $tempout | sed -e 's/\[[0-9a-zA-Z\.]*\]//g;s/_//g;/^ *$/d' >> $moviedata
    sed -i '/^ *- $/d;s/^ *- //g' $moviedata
    sed -i 's/ *Overview$/\n---Overview---/' $moviedata
    sed -i 's/ *Cast.*/\n---Cast---/' $moviedata
    sed -i 's/ *Besetzung.*/\n---Besetzung---/' $moviedata
    sed -i 's/ *Additional Details$/\n---Additional Details---/' $moviedata
    sed -i 's/ *Fun Stuff$/\n---Fun Stuff---/' $moviedata
    sed -i 's/ *Fun-Ecke$/\n---Fun-Ecke---/' $moviedata
    sed -i 's/ *User Comments.*/\n---User Comments---/' $moviedata
    sed -i 's/ *Nutzerkommentare.*/\n---Nutzerkommentare---/' $moviedata
    sed -i 's/FAQ$/FAQ:/g' $moviedata
    sed -i 's/^MOVIEmeter:.*/Movie Meter:/g' $moviedata
    sed -i 's/mehr\.\.\.$//g;s/why?//g;/.*Diskussionsforen.*/d;s/^ *//g;s/ *\.\.\. */ \.\.\. /g;s/^\(.*\):$/\n\1:/' $moviedata
    sed -i -e :a -e 'N; s/:\n\([^\n]*\)\n\n/: \1\n\n/g; ba' $moviedata #oneliners zusammenfassen


    #backup
    cp $moviedata $cachefolder/$title.info


    fi


    #Zeige im OSD falls aus commands.conf aufgerufen
    if [ $calltype = $CMDCONFCALL ]
    then
    dummy=$($svdrp hitk Commands)
    dummy=$($svdrp hitk $commandNo)
    elif [ $calltype = $RECCMDCONFCALL ]
    #oder gib direkt aus, falls der Aufruf aus der reccmds.conf kam
    then
    cat $moviedata
    fi;



    #cleanup
    #rm $tempout


    if $MPLAYER
    then
    exit 2
    else
    exit 0
    fi;

    Das mit die Symbole kommt mir bekannt vor. Jetzt am Arbeit so kann es nicht genau nachschauen aber ich denke du musst in Menu das font auf: VDR Symbols einstellen. Mann kann 3 fonts einstellen in menu. Ich habe 1 und 2 auf font VDR Symbols umgestellt und die Symbole sind zuruck.


    (vielleicht auch eine Symbole update gemacht aber ich bin davond nicht sicher. Probiere mal erst die fonst zu andern.


    Grussen aus Holland, Peter

    Vielleicht version 0.0.4 fur die andere Nachbarn? :-))


    Grussen aus Holland, Peter


    EDIT: Very impressive Ardi. Thank you very much for the "Hollandische Liga".
    Danke schon! Seht wirklich toll auss. Frohes Wochende. Danke! :portal1