SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #441  
Old 05-02-2016, 08:15 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by jonnydeath View Post
Is there an API for this plugin?

I am making an Alexa skill, and it would be awesome if I can ask SageTV to play a youtube video by voice. Can I call your plugin from a sagex javascript with a string, search for a video, and automatically play top result on a UIContext?
There is an API but it's geared towards playing the videos from within the STV. I'm not sure if/how it could interact with sagex. It would be cool if it did Let me ask Sensei stuckless about it.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #442  
Old 05-02-2016, 08:29 PM
jonnydeath jonnydeath is offline
Sage User
 
Join Date: Apr 2008
Posts: 51
Quote:
Originally Posted by tmiranda View Post
There is an API but it's geared towards playing the videos from within the STV. I'm not sure if/how it could interact with sagex. It would be cool if it did Let me ask Sensei stuckless about it.
Thanks. I got the basics working myself. I still need to figure out how to wait until clip is downloaded before trying to play the file. I also haven't figured out how to get better matches (like highest rating). I used JD on your plugin, I hope you don't mind!

I also (not shown) can get the URL to stream the file, but I couldn't see how sage to make play that stream. I wonder what the best approach would be.

function PlayYT(name) {

var ytpi = Packages.tmiranda.youtube;
var downloadDirectory = 'E:/DownloadedShowsNew/YouTube/';

var searchResults = ytpi.Search();
var newResults = searchResults.searchByKeyword(name) ;
var vidId = searchResults.getVideoId(newResults.get(0));

var downLoader = ytpi.DownloadVideo(vidId,downloadDirectory);
downLoader.start();

var UIContext = Packages.sagex.UIContext;

var fileName = downloadDirectory + vidId + '.mp4';
var file = new java.io.File(fileName);

var names = Global.GetConnectedClients();
MediaPlayerAPI.WatchLocalFile(new UIContext(names[0]),file );
Global.SageCommand(new UIContext(names[0]),'TV');
}

Last edited by jonnydeath; 05-02-2016 at 09:31 PM.
Reply With Quote
  #443  
Old 05-03-2016, 06:44 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by jonnydeath View Post
Thanks. I got the basics working myself. I still need to figure out how to wait until clip is downloaded before trying to play the file. I also haven't figured out how to get better matches (like highest rating). I used JD on your plugin, I hope you don't mind!

I also (not shown) can get the URL to stream the file, but I couldn't see how sage to make play that stream. I wonder what the best approach would be.

function PlayYT(name) {

var ytpi = Packages.tmiranda.youtube;
var downloadDirectory = 'E:/DownloadedShowsNew/YouTube/';

var searchResults = ytpi.Search();
var newResults = searchResults.searchByKeyword(name) ;
var vidId = searchResults.getVideoId(newResults.get(0));

var downLoader = ytpi.DownloadVideo(vidId,downloadDirectory);
downLoader.start();

var UIContext = Packages.sagex.UIContext;

var fileName = downloadDirectory + vidId + '.mp4';
var file = new java.io.File(fileName);

var names = Global.GetConnectedClients();
MediaPlayerAPI.WatchLocalFile(new UIContext(names[0]),file );
Global.SageCommand(new UIContext(names[0]),'TV');
}
The code is all open source, you are welcome to do whatever you want with it. I still need to post it on GitHub. In the meantime I should create a JavaDoc for you. I don't have much time and it may take a while. If you like I can email you the code and you can see all of the methods there.

You can use the downloadVideo to do the download but you will have to manually check to see when it's complete. There is no external API that will do that for you.

If you want to do progressive playback (i.e. Start playing before the video download is complete) you will need to use the functionality available in the Sage core. Take a look at the core APIs for for info. In the YouTube plugin this is done in the STV, not in Java.
  1. Create a temporary file. (Using the standard Java method.)
  2. Start the download using the StartFileDownload() method.
  3. Wait until you have a few seconds of playback downloaded. (I forget the API for that.)
  4. Use CreateTempMediaFile() (again, API name may be wrong) using the temp file created in step 1.
  5. Populate the temp MediaFile with metadata (so the OSD displays correctly.)
  6. Pass the temp MediaFile to Watch()

The Sage core then handles the progressive playback for you.

If you want me to send you the code PM me your email address.

You can also take a look at the STV to see how the tmiranda.youtube methods work. To open Studio start a SageClient and then press Ctrl-Alt-F12. When Studio opens use search to look for "tmiranda_youtube". That will give you a list of all the YouTube APIs that are used. (In Studio you use "_" and not "." to specify Java classes.)
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #444  
Old 05-03-2016, 09:07 PM
jonnydeath jonnydeath is offline
Sage User
 
Join Date: Apr 2008
Posts: 51
thanks. That seems to work very well!!!
Reply With Quote
  #445  
Old 05-07-2016, 07:52 AM
Gaurav's Avatar
Gaurav Gaurav is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Sugar Land, TX
Posts: 205
Tom - i'm having a problem with the recording engine.

I've set the download location for videos to one of my library folders on E drive. I can see that the engine runs but the videos never show up in Sage. Instead I see a bunch of video files with cryptic names (youtube file name?) sitting in the youtube_downloads folder under the SageTV folder on the C drive. Eventually the C drive fills up and things come to a grinding halt.

I think there are some other issues as well such as the "recommended videos" does not seem to refresh anymore, at least not as often as it used to. It adds one or two new videos a week. Prior to this problem it was far more dynamic.

This has been going on for a while now. I've tried uninstalling the plugin, deleting all youtube related properties and files, re-installing the plugin but nothing has worked. Obviously I am missing something as even after uninstall/delete/reinstall, the plugin seems to remember my favorites and settings.

Please help me get this fabulous plugin going again.

Last edited by Gaurav; 05-07-2016 at 07:56 AM.
Reply With Quote
  #446  
Old 05-07-2016, 08:00 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by Gaurav View Post
Tom - i'm having a problem with the recording engine.

I've set the download location for videos to one of my library folders on E drive. I can see that the engine runs but the videos never show up in Sage. Instead I see a bunch of video files with cryptic names (youtube file name?) sitting in the youtube_downloads folder under the SageTV folder on the C drive. Eventually the C drive fills up and things come to a grinding halt.

I think there are some other issues as well such as the "recommended videos" does not seem to refresh anymore, at least not as often as it used to. It adds one or two new videos a week. Prior to this problem it was far more dynamic.

This has been going on for a while now. I've tried uninstalling the plugin, deleting all youtube related properties and files, re-installing the plugin but nothing has worked. Obviously I am missing something as even after uninstall/delete/reinstall, the plugin seems to remember my favorites and settings.

Please help me get this fabulous plugin going again.
Please send me a logfile to look at.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #447  
Old 05-07-2016, 09:13 AM
Gaurav's Avatar
Gaurav Gaurav is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Sugar Land, TX
Posts: 205
Quote:
Originally Posted by tmiranda View Post
Please send me a logfile to look at.
I think I've fixed it myself. I generated the log file and saw that it was not being able to find the base YouTube folder on E drive (probably because I had deleted it as part of my cleanup thinking it would get recreated automatically when I re-install the plugin). I recreated the folder by hand and all is back to normal.

I did notice however that the temp file location setting is being ignored. I have set it to "H:\YouTubeTemp" but the plugin still uses the SageTV\youtube_downloads location. Not a big problem but might be something you want to look into.
Reply With Quote
  #448  
Old 05-07-2016, 07:31 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by Gaurav View Post
I think I've fixed it myself. I generated the log file and saw that it was not being able to find the base YouTube folder on E drive (probably because I had deleted it as part of my cleanup thinking it would get recreated automatically when I re-install the plugin). I recreated the folder by hand and all is back to normal.

I did notice however that the temp file location setting is being ignored. I have set it to "H:\YouTubeTemp" but the plugin still uses the SageTV\youtube_downloads location. Not a big problem but might be something you want to look into.
Glad you got it fixed

The temp file location only applies to when you are watching a video. When a video is recorded it always gets downloaded to the youtube_downloads folder and then it gets moved to its final location. It's done that way to avoid complications that can arise if the user chooses a network drive as a download location. If you see the youtube_downloads folder filling up then that's a bug.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #449  
Old 05-08-2016, 06:59 AM
Gaurav's Avatar
Gaurav Gaurav is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Sugar Land, TX
Posts: 205
Quote:
Originally Posted by tmiranda View Post
Glad you got it fixed

The temp file location only applies to when you are watching a video. When a video is recorded it always gets downloaded to the youtube_downloads folder and then it gets moved to its final location. It's done that way to avoid complications that can arise if the user chooses a network drive as a download location. If you see the youtube_downloads folder filling up then that's a bug.
Got it. Thanks
Reply With Quote
  #450  
Old 05-27-2016, 03:48 PM
Rob23 Rob23 is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 101
disable viewing history

Is there a way to disable the capture of viewing history? Is there a way to clear the viewing history?
Reply With Quote
  #451  
Old 05-29-2016, 05:00 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by Rob23 View Post
Is there a way to disable the capture of viewing history? Is there a way to clear the viewing history?
Yes, I think you can configure both of these things in the Options menu.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #452  
Old 06-02-2016, 09:53 AM
Rob23 Rob23 is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 101
Quote:
Originally Posted by tmiranda View Post
Yes, I think you can configure both of these things in the Options menu.
I must be overlooking the option. I see an option to clear search history, but I don't see where one can clear the viewing history or disable the capture of viewing history. Where are these options and how are they labelled?
Reply With Quote
  #453  
Old 06-09-2016, 06:57 AM
krasev's Avatar
krasev krasev is offline
Sage Advanced User
 
Join Date: Jul 2006
Location: Philadelphia, PA USA
Posts: 78
Question The Cyrillic search bug

Quote:
Originally Posted by tmiranda View Post
Thanks.

Nest things I will look at:
- The Cyrillic search bug.
- Customizing the main menu.

If there are any other features or requests please post them here.
any news about The Cyrillic search bug?
__________________
Intel® Celeron® Quad-Core Processor J1900 @ 1.99 GHz; AsRock Q1900M (Intel(R) Chipset (2013-08-01) Ver.9.4.4.1006 Lithography 22 nm; Bay Trail-M/D SOC (formerly known as ValleyView2); RAM 2x4Gb Kingston 1600MHz PC3-12800 DDR3; SSD 128GB & HDD 2TB; SageTV HD200 (Firmware v.20100909 0); Hauppauge HVR-2250 PCI-E; Hauppauge HD PVR-1212; USB-UIRT; Win7Ultimate SP1; FireFox v.41.0.2; SageTV v.9.0.4.224 (STV v.2015101301); VLC v2.2.1; JRE v.1.8.00_73
Reply With Quote
  #454  
Old 06-09-2016, 11:24 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by krasev View Post
any news about The Cyrillic search bug?
No, still haven't been able to track it down. I'll keep trying....
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #455  
Old 06-11-2016, 05:08 PM
jorton jorton is offline
Sage Icon
 
Join Date: Jul 2005
Location: Canada
Posts: 1,273
Youtube File Resolution

I see that I can select "best" for the Video Format in Recording Options, but I always seem to get 720P files. I know that the channels I am watching post in 1080p. Am I missing a setting somewhere for this?

I have tried to change "best" but it does not allow me to change (stays as "best" when I hit enter) although I am not actually sure of the official options here.

Thanks, we use this plugin daily.

J
Reply With Quote
  #456  
Old 06-12-2016, 04:27 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by jorton View Post
I see that I can select "best" for the Video Format in Recording Options, but I always seem to get 720P files. I know that the channels I am watching post in 1080p. Am I missing a setting somewhere for this?

I have tried to change "best" but it does not allow me to change (stays as "best" when I hit enter) although I am not actually sure of the official options here.

Thanks, we use this plugin daily.

J
Look under "Format Selection" here: https://github.com/rg3/youtube-dl/bl...ADME.md#readme

You can specify any of those parameters. According to the documentation "best" should give you the best available video. If it isn't I'd suggest using the "height" parameter.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #457  
Old 07-30-2016, 12:45 PM
Rob23 Rob23 is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 101
Is there a way to organize favorite channels into folders in order for them to show up in new folders or categories when browsing favorite channels?

I've looked in every property file I can think of, but I have not been able to locate where this plugin is storing the list of my favorite channels.
Reply With Quote
  #458  
Old 08-01-2016, 06:33 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by Rob23 View Post
Is there a way to organize favorite channels into folders in order for them to show up in new folders or categories when browsing favorite channels?

I've looked in every property file I can think of, but I have not been able to locate where this plugin is storing the list of my favorite channels.
I'm not sure what you are asking for. When you create a Favorite you can choose the target download subdirectory.

You won't find the list of Favorites in any property file, it's stored in the wiz.bin via the UserRecord API.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #459  
Old 08-01-2016, 07:59 AM
Rob23 Rob23 is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 101
Quote:
Originally Posted by tmiranda View Post
I'm not sure what you are asking for. When you create a Favorite you can choose the target download subdirectory.

You won't find the list of Favorites in any property file, it's stored in the wiz.bin via the UserRecord API.
Perhaps it is because I do not use the download feature. I just wanted to know if there is a way to organize my favorite channels within the browse favorite channels menu selection so that I could set up subfolders to browse. For example:

-Browse Favorite Channels
- Category A
- Favorite channel 1, 2, etc.
- Category B
- Favorite 8,9, etc.

Is this something I could do within the UserRecord API?
Reply With Quote
  #460  
Old 08-01-2016, 11:22 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,842
Quote:
Originally Posted by Rob23 View Post
Perhaps it is because I do not use the download feature. I just wanted to know if there is a way to organize my favorite channels within the browse favorite channels menu selection so that I could set up subfolders to browse. For example:

-Browse Favorite Channels
- Category A
- Favorite channel 1, 2, etc.
- Category B
- Favorite 8,9, etc.

Is this something I could do within the UserRecord API?
Ah, now I see.

There is currently no way to do that.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plex Hacked July 1, 2015 tvmaster2 General Discussion 5 07-08-2015 02:43 AM
Will 2015 leap second effect SageTV? Paul H SageTV Software 10 01-16-2015 07:43 AM
Merry Christmas & Happy New Year 2015 SHS General Discussion 25 01-01-2015 08:59 PM
Plugin request for SageTV Windows Client: Autofrequency plugin mkanet SageTV v7 Customizations 3 11-12-2011 09:33 AM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM


All times are GMT -6. The time now is 04:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.