Changeset 40148


Ignore:
Timestamp:
Feb 27, 2017, 1:33:06 AM (3 years ago)
Author:
obi
Message:

optimize youtube

Location:
titan/mediathek
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/hoster.sh

    r40134 r40148  
    208208        echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
    209209#       $BIN $youtubebin "$INPUT"
    210         $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" -g "$INPUT"
     210        $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --all-formats -g "$INPUT"
    211211}
    212212
  • titan/mediathek/localparser_free/youtube.sh

    r40146 r40148  
    4040mainmenu()
    4141{
    42 #       echo "Category#$SRC $SRC category#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" > $TMP/$FILENAME.list
    4342        echo "Search 10#$SRC $SRC search '/youtube/v3/search?q=%search%&regionCode=US&part=snippet&hl=en_US&key=AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA&type=video&maxResults=10'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >$TMP/$FILENAME.list
    4443        echo "Search 50#$SRC $SRC search '/youtube/v3/search?q=%search%&regionCode=US&part=snippet&hl=en_US&key=AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA&type=video&maxResults=50'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
    45         echo "Search 100#$SRC $SRC search '/youtube/v3/search?q=%search%&regionCode=US&part=snippet&hl=en_US&key=AIzaSyAd-YEOqZz9nXVzGtn3KWzYLbLaajhqIDA&type=video&maxResults=100'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
    4644        echo "$TMP/$FILENAME.list"
    4745}
     
    5957                        TITLE=`echo $ROUND | sed 's!"title": !\ntitle=!g' | grep ^title= | cut -d'"' -f2 | tail -n1`
    6058#                       URL="/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=$ID&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1"
    61                         URL="https://www.youtube.com/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=$ID&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1"
     59#                       URL="https://www.youtube.com/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=$ID&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1"
    6260                        NEWPAGE="https://www.youtube.com/watch?v=$ID"
    6361
     
    7977                                fi
    8078                                piccount=$[$piccount+1]
    81 #                               LINE="$TITLE#$SRC $SRC list '$URL'#$PIC#$FILENAME_$piccount.jpg#$NAME#0"
    8279#                               LINE="$TITLE#$URL#$PIC#$FILENAME_$piccount.jpg#$NAME#14"
    83                                 LINE="$TITLE#$SRC $SRC hoster '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
     80#                               LINE="$TITLE#$SRC $SRC hoster '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
     81                                LINE="$TITLE#$SRC $SRC hosterlist '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#0"
    8482                                echo "$LINE" >> $TMP/$FILENAME.list
    8583                        fi
     
    9189}
    9290
     91hosterlist()
     92{
     93        if [ ! -e "$TMP/$FILENAME.list" ]; then
     94                /tmp/localhoster/hoster.sh youtube_dl $PAGE > $TMP/cache.$FILENAME.1
     95
     96                while read -u 3 ROUND; do
     97                        TITLE=`echo $ROUND | sed 's/mime=/\nfound=\&/g' | grep ^"found=&" | cut -d'&' -f2 | sed 's#%2F#/#g'`
     98                        PIC="`echo $TITLE | tr '/' '.'`.jpg"
     99                        NEWPAGE="$ROUND"
     100
     101                        if [ -z "$PIC" ] || [ "$PIC" = ".jpg" ]; then
     102                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
     103                        fi
     104
     105                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
     106                                if [ ! -e $TMP/$FILENAME.list ];then
     107                                        touch $TMP/$FILENAME.list
     108                                fi
     109                                piccount=$[$piccount+1]
     110                                LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
     111                                echo "$LINE" >> $TMP/$FILENAME.list
     112                        fi
     113
     114                done 3<$TMP/cache.$FILENAME.1
     115                rm $TMP/cache.* > /dev/null 2>&1
     116        fi
     117        echo "$TMP/$FILENAME.list"
     118}
     119
     120play()
     121{
     122        rm $TMP/cache.$INPUT.* > /dev/null 2>&1
     123        /tmp/localhoster/hoster.sh get $PAGE > $TMP/cache.$INPUT.1
     124        STREAMURL=`cat $TMP/cache.$INPUT.1`
     125        echo $STREAMURL
     126}
     127
    93128hoster()
    94129{
    95         rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
    96         /tmp/localhoster/hoster.sh youtube_dl $PAGE > $TMP/cache.$FILENAME.1
    97         STREAMURL=`cat $TMP/cache.$FILENAME.1 | head -n1`
     130# not used anymore
     131#       rm $TMP/cache.$INPUT.* > /dev/null 2>&1
     132        /tmp/localhoster/hoster.sh youtube_dl $PAGE > $TMP/cache.$INPUT.1
     133        STREAMURL=`cat $TMP/cache.$INPUT.1`
    98134        echo $STREAMURL
    99135}
     
    103139        mainmenu) $INPUT;;
    104140        hoster) $INPUT;;
     141        hosterlist) $INPUT;;
     142        play) $INPUT;;
    105143        search) $INPUT;;
    106144esac
Note: See TracChangeset for help on using the changeset viewer.