Giter Site home page Giter Site logo

kktuax / youtupi Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 6.0 1.98 MB

YouTube (mobile) web frontend for your Raspberry Pi

Home Page: https://maxtuni.es/2013/02/16/Introducing-YouTuPi.html

Shell 1.82% CSS 1.00% Python 51.27% JavaScript 34.44% HTML 11.48%
raspberry-pi youtube

youtupi's People

Contributors

kktuax avatar orithena avatar pvl1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

youtupi's Issues

Any way to change the port?

Hi,
first of all thanks for your work! My new setup requires the web interface to run on a different port (8080 is already used) Is there any way to change the used port?

how to debug, where are logs?

I followed the instructions installing youtupi in my raspbian, I get the UI to search and everything, but I hear no sound. I'm having troubles to debug because I can't find logs or any clue of what's going wrong.

Please advise

URL Format Error

While trying to play a Youtube video the following message appears and nothing happens.

Reading config from: /home/pi/youtupi
http://0.0.0.0:8080/
193.137.170.54:55071 - - [18/Mar/2014 10:28:53] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:28:54] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:28:56] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:28:59] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:02] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:02] "HTTP/1.1 POST /playlist" - 303 See Other
193.137.170.57:49876 - - [18/Mar/2014 10:29:02] "HTTP/1.1 GET /playlist" - 200 OK
Locating URL for: r75BFcH4u2k
193.137.170.57:49876 - - [18/Mar/2014 10:29:04] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:07] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:09] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:12] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:14] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:17] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:19] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:22] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:24] "HTTP/1.1 GET /playlist" - 200 OK
Unable to fetch valid URL in format: 22
193.137.170.54:55071 - - [18/Mar/2014 10:29:27] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:29] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:32] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:49876 - - [18/Mar/2014 10:29:34] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:55071 - - [18/Mar/2014 10:29:37] "HTTP/1.1 GET /playlist" - 200 OK
Unable to fetch valid URL in format: 18
(..)

I'm using latest updated version.

Thank you!

Playback issues

The videos are randomly skipped when they are expected to play.

When you add a video to the playlist, it stays there for a few seconds in the first position and then disappears with no feedback.

This problem will clear an entire playlist by skipping all of the videos sequentially.

You are probably able to play the video after insisting on adding and re-adding it to the playlist.

I have tested the URL provided to omxplayer and it works on browser.

The YouTuPi and omxplayer are updated to the latest versions.

LOG:

Reading config from: /home/pi/youtupi/youtupi
http://0.0.0.0:8080/
193.137.170.54:49862 - - [05/Feb/2014 16:47:24] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:40771 - - [05/Feb/2014 16:47:28] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:49862 - - [05/Feb/2014 16:47:28] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:40771 - - [05/Feb/2014 16:47:32] "HTTP/1.1 POST /playlist" - 303 See Other
193.137.170.57:40771 - - [05/Feb/2014 16:47:32] "HTTP/1.1 GET /playlist" - 200 OK
Locating URL for: rn_YodiJO6k
193.137.170.57:40771 - - [05/Feb/2014 16:47:33] "HTTP/1.1 GET /playlist" - 200 OK

193.137.170.57:40771 - - [05/Feb/2014 16:47:48] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:49862 - - [05/Feb/2014 16:47:48] "HTTP/1.1 GET /playlist" - 200 OK
Running player: omxplayer -o local --live http://r1---sn-apn7en7s.googlevideo.com/videoplayback?mv=m&id=ae7fd8a1d8893ba9&ip=193.137.170.59&key=yt5&expire=1391642635&source=youtube&pcm2fr=yes&sver=3&mt=1391618745&ipbits=0&ms=au&itag=18&ratebypass=yes&fexp=926550%2C927610%2C921098%2C932273%2C936910%2C936913&sparams=id%2Cip%2Cipbits%2Citag%2Cpcm2fr%2Cratebypass%2Csource%2Cupn%2Cexpire&upn=HJK3nufgZhI&signature=E54D34DF295906DC24E355FDEF9179ED8F2EE3ED0BA2.D8AA19698AD4FDF309B7A146BF422C2B0A
193.137.170.57:40771 - - [05/Feb/2014 16:47:53] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.54:49862 - - [05/Feb/2014 16:47:53] "HTTP/1.1 GET /playlist" - 200 OK
193.137.170.57:40771 - - [05/Feb/2014 16:47:58] "HTTP/1.1 GET /playlist" - 200 OK

Youtube Playlist Support

These changes adds the ability to search for existing YouTube playlists. Searching for a playlist list=id (e.i "list=PLFs4vir_WsTwEd-nJgVJCZPNL3HALHHpF") returns the playlist songs.

Updated youtupi.youtube.js:
function getYoutubeQueryUrl(){
var url;
var query = $("#search-basic").val().trim();
if(query != ''){
if(query.indexOf("list=") > -1){
var lid = query.split("=");
url = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId='+lid[1]+'&type=video&maxResults='+$('#slider').val()+'&key=AIzaSyAdAR3PofKiUSGFsfQ03FBEpVkVa1WA0J4';
} else {
url = 'https://www.googleapis.com/youtube/v3/search?order=relevance&part=snippet&q='+query+'&type=video&maxResults='+$('#slider').val()+'&key=AIzaSyAdAR3PofKiUSGFsfQ03FBEpVkVa1WA0J4';
}
}
return url;
}

function getYoutubeResponseVideos(response){
var videos = [];
var entries = response.items || [];
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
if(typeof entry.video != 'undefined'){
entry = entry.video;
}
var video = {}
if(typeof entry.id.videoId != 'undefined'){
video.id = entry.id.videoId;
} else {
video.id = entry.snippet.resourceId.videoId;
}
video.description = entry.snippet.description;
video.title = entry.snippet.title;
video.duration = entry.duration;
if(typeof entry.snippet.thumbnails != 'undefined'){
if(typeof entry.snippet.thumbnails.high != 'undefined'){
video.thumbnail = entry.snippet.thumbnails.high.url;
}else if(typeof entry.snippet.thumbnails.medium != 'undefined'){
video.thumbnail = entry.snippet.thumbnails.medium.url;
}else{
video.thumbnail = entry.snippet.thumbnails.default.url;
}
}
video.type = "youtube";
video.operations = [ {'name': 'download', 'text': 'Download', 'successMessage': 'Video downloaded'} ];
videos.push(video);
}
return videos;
}

LCD screen backlight blink

I have kind of clock on Nokia LCD Screen pcd8544. Backlight of this LCD are continously turn on. When I play som video from youtube throught youtupi then that backlight start blinking, and finally turn off. After that only way to turn it on is restart of my clock service. When I use omxplayer outside youtupi there is no such issue.
Cheers

Error (and solution) while running "service youtupi start"

Hello,

this error started happening to me after some upgrade on my Raspbian.
If I'd run /etc/init.d/youtupi start it works fine, but not via service.
This is the error:

-- Unit youtupi.service has begun starting up.
Apr 30 21:11:46 raspberrypi systemd[1846]: Failed at step EXEC spawning /etc/init.d/youtupi: Exec format error
-- Subject: Process /etc/init.d/youtupi could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

I'm not sure if more people have experienced that or will, but I thought it would be important to give you the info.
After some debugging I figured the problem was the line #! /bin/sh not being the first line of the file.
No idea if it's a bug somewhere or if not placing it on the first line is really a mistake that *sh take care of, but I think it would be useful to update the file service/youtupi with this correction.

In any case, spot on, great work!

Slow local search

Hey Max,
it looks like the search for the local function is really slow,
maybe it is some problem of me or do you know why ?
im using youtupi on a Raspberry pi Rev B with 512 MB Ram
when im using the normal function "find path | grep Name (with pattern)"
its much faster or the php script i did write until i did see ur programm...
maybe u know a answer for this

Thank You

permission issues when trying to play video

10.0.0.4:54268 - - [17/Apr/2014 02:56:36] "HTTP/1.1 POST /playlist" - 303 See Other
10.0.0.4:54276 - - [17/Apr/2014 02:56:36] "HTTP/1.1 GET /playlist" - 200 OK
10.0.0.4:54276 - - [17/Apr/2014 02:56:36] "HTTP/1.1 GET /playlist" - 200 OK
Locating URL for: TFHbAvY1kJ4
Exception in thread Thread-32:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in *bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 760, in run
self.function(_self.args, _self.kwargs)
File "/home/pi/youtupi/youtupi/playlist.py", line 131, in autoPlay
prepareVideo(nvideo)
File "/home/pi/youtupi/youtupi/playlist.py", line 122, in prepareVideo
url = youtube.getUrl(video.data)
File "/home/pi/youtupi/youtupi/modules/youtube.py", line 11, in getUrl
formats = getYoutubeFormats(data['id'])
File "/home/pi/youtupi/youtupi/modules/youtube.py", line 24, in getYoutubeFormats
yt_dl = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init

errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.