Changeset 43091


Ignore:
Timestamp:
12/04/18 03:09:15 (5 years ago)
Author:
obi
Message:

optimize movie

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localparser_secret/movie4k.sh

    r43090 r43091  
    642642hosterlist()
    643643{
    644 #rm $TMP/$FILENAME.list
     644#$curlbin $URL/$PAGE -o /tmp/localparser/1234
     645
     646rm $TMP/$FILENAME.list
    645647        if [ ! -e "$TMP/$FILENAME.list" ]; then
    646648                $curlbin -o - $URL/$PAGE | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \
     
    665667                                            j = index(substr($0, i), "\x27") - 1
    666668                                            newpage = substr($0, i, j)
     669#print "0" newpage
     670
     671                                                if (newpage == "")
     672                                                {
     673                                                        i = index($0, "href=\\\"") + 7
     674                                                j = index(substr($0, i), "\\") - 1
     675                                                newpage = substr($0, i, j)
     676#print "1" newpage
     677                                                }
     678
     679                                                if (newpage == "")
     680                                                {
     681                                                        i = index($0, "href=\"") + 6
     682                                                j = index(substr($0, i), "\">") - 1
     683                                                newpage = substr($0, i, j)
     684#print "3" newpage
     685                                                }
    667686
    668687                                                # extrahiere den title pfad
     
    674693                                        j = index(substr($0, i), "<") - 1
    675694                                        extra = substr($0, i, j)
     695#print "4" extra
     696
     697                                                if (extra == "")
     698                                                {
     699                                                        i = index($0, "html\">") + 5
     700                                                j = index(substr($0, i), "<") - 1
     701                                                extra = substr($0, i, j)
     702#print "5" extra
     703
     704                                                }
     705                                                if (extra ~ /tablemoviesindex2/)
     706                                                        extra = ""
     707
     708                                                if (extra ~ /PT>/)
     709                                                        extra = ""
     710
     711                                                if (newpage ~ /movie-/)
     712                                                {
     713                                                        i = index(newpage, "movie-") + 6
     714                                                j = index(substr(newpage, i), ".html") - 1
     715                                                extra2 = substr(newpage, i, j)
     716                                                }
     717                                                if (newpage ~ /tvshows-/)
     718                                                {
     719                                                        i = index(newpage, "tvshows-") + 8
     720                                                j = index(substr(newpage, i), "-") - 1
     721                                                extra2 = substr(newpage, i, j)
     722                                                }
    676723
    677724#print 123 $0
    678725#print "newpage" newpage
    679726#print "extra" extra
     727#print "extra2" extra2
    680728#print "title" title
    681729
     
    684732                                                        pic = tolower(title)
    685733                                                        split(pic, a, ".")
    686 #                                                       title = title " (" extra ")"
     734
     735
     736                                                        if (extra != "" )
     737                                                        {
     738                                                                # trim left "  Hallo   tester   "
     739                                                                gsub(/^[ \t]+/,"",extra)
     740                                                                # trim right "  Hallo   tester   "
     741                                                                gsub(/[ \t]+$/,"",extra)
     742                                                                # trim middle "  Hallo   tester   "
     743                                                                gsub(/\t+/," / ",extra)
     744                                                        }
     745                                                        if (extra2 != "" )
     746                                                        {
     747                                                                # trim left "  Hallo   tester   "
     748                                                                gsub(/^[ \t]+/,"",extra2)
     749                                                                # trim right "  Hallo   tester   "
     750                                                                gsub(/[ \t]+$/,"",extra2)
     751                                                                # trim middle "  Hallo   tester   "
     752                                                                gsub(/\t+/," / ",extra2)
     753                                                        }
     754                                                        if (extra != "" && extra2 != "")                               
     755                                                                title = title " (" extra2 " - " extra ")"
     756                                                        else if(extra != "")
     757                                                                title = title " (" extra ")"
     758                                                        else if(extra2 != "")
     759                                                                title = title " (" extra2 ")"
     760
     761                                                        # trim left "  Hallo   tester   "
     762                                                        gsub(/^[ \t]+/,"",title)
     763                                                        # trim right "  Hallo   tester   "
     764                                                        gsub(/[ \t]+$/,"",title)
     765                                                        # trim middle "  Hallo   tester   "
     766                                                        gsub(/\t+/," / ",title)
     767
    687768                                                        if ( pic == "" )
    688769                                                        {
Note: See TracChangeset for help on using the changeset viewer.