Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_youtube (Read 491586 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_youtube

Reply #550
Yes, "Youtube Search (Integrated)" UI panel does not have its own list for search results and uses playlist for this. It can be active playlist or some specific playlist (configured through search context menu of the panel).

So, what do you mean? To have its own results list in the panel? Or to use list from "Youtube Source" window when searching using "Youtube Search (Integrated)" UI panel?

Re: foo_youtube

Reply #551
I would like the Integrated panel to show results inside the panel, instead of sending them automatically to a playlist. If it's possible,of course.

Re: foo_youtube

Reply #552
Ok, noted. But probably not in the next version.

Re: foo_youtube

Reply #553
Thanks!

Re: foo_youtube

Reply #554
I put a lot of annotations in a tag inside the mp3 I found interesting, so it would be great if I could save as files those Youtube tunes greatly provided by your plugin.

If you are not interested in adding this, for ex. as a context choice, maybe you can suggest some scripting ideas to achieve it.

Re: foo_youtube

Reply #555
Thank you for the great plug-in for foobar.

Is there any chance of playing the local media file (video + audio) with foo_youtube?
It would be great if the media files in the special playlist (for exameple, "Music Video" something like that) can be palyed with foo_youtube.

Re: foo_youtube

Reply #556
New version 1.11.4

Changelog:
- Twitter's link service (t.co) support. Might be useful when t.co link points to supported site - now don't need to manually determine actual URL using the browser. More info: About Twitter's link service
- check LAV Filters version before use. Includes checking for minimum required version and checking for newer version. Last one is for case when has internal filters (preconf_video) and filters installed in the system. Previously was used installed filters regardless of their version, now will be used filters with newer version
- fix for Youtube due to change on the site, relates to "Write error" at the page analysis. This is emergency fix, release issued right now only because of it

Re: foo_youtube

Reply #557
@renega
Not quite understand what you mean.

@widerock
No chance within this component, sorry.

Re: foo_youtube

Reply #558
I simply want to save a youtube tune I'm listening with your plugin as an mp3 file on my hdd.
(or mp4 or any other audio file readable by foobar)

Re: foo_youtube

Reply #559
I simply want to save a youtube tune I'm listening with your plugin as an mp3 file on my hdd.
(or mp4 or any other audio file readable by foobar)


You can already save all videos as mp3 using ''context menu>convert '', you need lame for mp3(default is saved as wav) search google, download lame, then configure this in converter.. You can also make button for this..

Re: foo_youtube

Reply #560
New version 1.11.4

Hi 3dyd, I thought you mentioned that the window not auto-closing on stop bug has been fixed ... I am still experiencing it with this update..
"Show video frame: automatically..." is selected in the settings.

Re: foo_youtube

Reply #561
No, I only confirmed the bug. It is not fixed yet. This intermediate release was because of critical fix for Youtube. And it contains only changes described in changelog. Except one - I forgot to mention that now keyboard shortcuts for 'expand get more' and 'search replacement' are available too.

Re: foo_youtube

Reply #562
3dyd, I have tag script, that writes tags(on track play), after tags are updated, if video plays, playback stop.
Can this be somehow avoided? This happens because foobar reopen file..

Re: foo_youtube

Reply #563
Not sure, maybe. You can send me the script to reproduce this so I'll be able to check what happens in the component.

Re: foo_youtube

Reply #564
Not sure, maybe. You can send me the script to reproduce this so I'll be able to check what happens in the component.

Ok, paste this script in WSH panel:
(Script will update genre tag from Last.fm).

Code: [Select]
// ==PREPROCESSOR==
// @name "Auto Tag"
// @author "Mire777"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==

//Properties
var api_key = window.GetProperty("Last.fm Api", "f21088bf9097b49ad4e7f487abab981e");
var AutoTag = window.GetProperty("Tag Auto", "1");
var Overwrite = window.GetProperty("Tag Overwrite", "0");
var objXMLHTTP = new ActiveXObject("MSXML2.XMLHTTP");
var top_tags_values;
var UpdateTags;
var text = "";

function on_playback_time (time) {
metadb = fb.GetNowPlaying();
if (!metadb) {return;}
if(AutoTag==1 && time==1)
{
top_tags_values=""; getTags();
}}

function RGB(r, g, b) {
    return (0xff000000 | (r << 16) | (g << 8) | (b));
}

ButtonStates = {
    normal: 0,
    hover: 1,
    down: 2,
    hide: 3
}

var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

var g_theme = window.CreateThemeManager("Button");
var g_font = gdi.Font("Tahoma",11);

function SimpleButton(x, y, w, h, text, fonClick, state) {
    this.state = state ? state : ButtonStates.normal;
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.text = text;
    this.fonClick = fonClick;

    this.containXY = function(x, y) {
        return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
    }

    this.changeState = function(state) {
        var old = this.state;
        this.state = state;
        return old;
    }

    this.draw = function(gr) {
        if (this.state == ButtonStates.hide) return;

        switch (this.state) {
            case ButtonStates.normal:
                g_theme.SetPartAndStateId(1, 1);
                break;

            case ButtonStates.hover:
                g_theme.SetPartAndStateId(1, 1);
                break;

            case ButtonStates.down:
                g_theme.SetPartAndStateId(1, 3);
                break;

            case ButtonStates.hide:
                return;
        }

        g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);
        gr.GdiDrawText(this.text, g_font, RGB(0, 0, 0), this.x, this.y, this.w, this.h, DT_WORDBREAK | DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
    }

    this.onClick = function() {
        this.fonClick && this.fonClick();
    }
}

function drawAllButtons(gr) {
    for (var i in $buttons) {
        $buttons[i].draw(gr);
    }
}

function chooseButton(x, y) {
    for (var i in $buttons) {
        if ($buttons[i].containXY(x, y) && $buttons[i].state != ButtonStates.hide) return $buttons[i];
    }

    return null;
}

$buttons = {
    FindTags: new SimpleButton(0, 0, (window.Height) - (window.Height)+27, (window.Height) - (window.Height)+22, "Tag", function() {
        rbtn_up(24, 17);
       
    }),

}

var cur_btn = null;
var g_down = false;

function on_size() {
ww = window.Width;
wh = window.Height;
    window.Repaint();
}

function on_paint(gr) {
    this.dui = window.InstanceType;
   
    if (this.dui) {
    col = window.GetColorDUI(1);
    gr.FillSolidRect(0, 0, ww, wh, col);
    }
    else
    {
    col = window.GetColorCUI(3);   
    }
   
    myfont = gdi.Font("Segoe UI", 12, 0)
    gr.FillSolidRect(0, 0, window.Width, window.Height, col);
    gr.GdiDrawText(text, myfont, col, 0, 40, window.Width, window.Height, DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
    drawAllButtons(gr);
}

function on_mouse_move(x, y) {
    var old = cur_btn;
    cur_btn = chooseButton(x, y);

    if (old == cur_btn) {
        if (g_down) return;
    } else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
        return;
    }

    old && old.changeState(ButtonStates.normal);
    cur_btn && cur_btn.changeState(ButtonStates.hover);
    window.Repaint();
}

function on_mouse_leave() {
    g_down = false;

    if (cur_btn) {
        cur_btn.changeState(ButtonStates.normal);
        window.Repaint();
    }
}

function on_mouse_lbtn_down(x, y) {
    g_down = true;

    if (cur_btn) {
        cur_btn.changeState(ButtonStates.down);
        window.Repaint();
    }
}

function on_mouse_lbtn_up(x, y) {
    g_down = false;

    if (cur_btn) {
        cur_btn.onClick();
        cur_btn.changeState(ButtonStates.hover);
        window.Repaint();
    }
}

//Menu
this.rbtn_up = function(x, y) {
var _menu = window.CreatePopupMenu();
var q = window.CreatePopupMenu();
var MF_GRAYED = 0x00000001;
var MF_STRING = 0x00000000;
var MF_SEPARATOR = 0x00000800;
var MF_POPUP = 0x00000010;
var idx;

if(AutoTag==1) _menu.AppendMenuItem(MF_STRING, 1, "Auto Tag");
if(AutoTag==0) _menu.AppendMenuItem(MF_STRING, 2, "Auto Tag");
_menu.CheckMenuItem(1, AutoTag?1:0);

_menu.AppendMenuSeparator();

if(Overwrite==1) _menu.AppendMenuItem(MF_STRING, 3, "Overwrite");
if(Overwrite==0) _menu.AppendMenuItem(MF_STRING, 4, "Overwrite");
_menu.CheckMenuRadioItem(3, 4, 4-1);

_menu.AppendMenuSeparator();

_menu.AppendMenuItem(MF_STRING, 5, "Get Tags...");

_menu.AppendMenuSeparator();

_menu.AppendMenuItem(MF_STRING, 6, "Properties...");

if (utils.IsKeyPressed(0x10)) _menu.AppendMenuItem(MF_STRING, 7, "Configure...");

        idx = _menu.TrackPopupMenu(x, y);
        switch(idx) {
         
          case 1:
                AutoTag = 0;
                window.SetProperty("Tag Auto", "0");
break;
               
          case 2:
                AutoTag = 1;
                window.SetProperty("Tag Auto", "1");
break;
               
          case 3:
                Overwrite = 0;
                window.SetProperty("Tag Overwrite", "0");
break;
               
          case 4:
                Overwrite = 1;
                window.SetProperty("Tag Overwrite", "1");
break;
               
          case 5:
                UpdateTags = 1;
                getTags();
break;

          case 6:
                window.ShowProperties();
break;
         
          case 7:   
                window.ShowConfigure();
                break;
               
            }
              _menu.Dispose();
          }

function getTags() {
    if (objXMLHTTP != null) {
    {
        metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
        if (!metadb) {return;}
        genre = fb.TitleFormat("%Genre%").EvalWithMetadb(metadb);
        artist = fb.TitleFormat("%artist%").EvalWithMetadb(metadb);
        title = fb.TitleFormat("%title%").EvalWithMetadb(metadb);
        file = fb.TitleFormat("%path%").EvalWithMetadb(metadb);
       
        {if (Overwrite==0 && genre>"?" && !UpdateTags) return;}
        if (artist == "" || artist == "?" || title == "" || title == "?") return;

        url = "https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=" + api_key + "&artist=" + encodeURIComponent(artist) + "&track=" + encodeURIComponent(title) + "&format=json";
       
        try {
            objXMLHTTP.open("GET", url, false);
            objXMLHTTP.setRequestHeader('User-Agent', "foobar2000_script");
            objXMLHTTP.send("");
            urlreadyState = (objXMLHTTP.readyState);
            urlstatus = (objXMLHTTP.status);
           
            if (urlreadyState == "4" && urlstatus == "200") {
            data = objXMLHTTP.ResponseText;
            objXMLHTTP.Close;
            }
           
            json_data = JSON.parse(data);

            artist_name = json_data.track.artist.name;
            title_name = json_data.track.name;

            top_tags = json_data.track.toptags.tag;
            top_tags_values = [];

            items = top_tags.length;

            if (top_tags.length > 0) {
            for (i = 0; i < items; i++) {
            name = json_data.track.toptags.tag[i].name.replace(/&amp;/g, " \& ");
            top_tags_values.push(name);
                }
            }
           
            fb.trace("Tags:" + top_tags_values);
            objXMLHTTP.Close;
           
          } catch (err) {
          objXMLHTTP.Close;
          }     
 
          if (top_tags_values>"")
          {
          tags = top_tags_values.toString();
          tags = tags.replace(/,/g, "/");
          metadb.UpdateFileInfoSimple("GENRE", tags);
          window.Repaint();
          UpdateTags = "";
          }
          else {getTags2();}
}}}

function getTags2() {
    if (objXMLHTTP != null) {
    {
        metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
        if (!metadb) {return;}
        genre = fb.TitleFormat("%Genre%").EvalWithMetadb(metadb);
        artist = fb.TitleFormat("%artist%").EvalWithMetadb(metadb);
        title = fb.TitleFormat("%title%").EvalWithMetadb(metadb);
        file = fb.TitleFormat("%path%").EvalWithMetadb(metadb);
   
        {if (Overwrite==0 && genre>"?" && !UpdateTags) return;}
        if (artist == "" || artist == "?" || title == "" || title == "?") return;

        url = "https://ws.audioscrobbler.com/2.0/?method=artist.getTopTags&api_key=" + api_key + "&artist=" + encodeURIComponent(artist) + "&format=json";
       
        try {
            objXMLHTTP.open("GET", url, false);
            objXMLHTTP.setRequestHeader('User-Agent', "foobar2000_script");
            objXMLHTTP.send("");
            urlreadyState = (objXMLHTTP.readyState);
            urlstatus = (objXMLHTTP.status);
            if (urlreadyState == "4" && urlstatus == "200") {
            data = objXMLHTTP.ResponseText;
            objXMLHTTP.Close;
            }

            json_data = JSON.parse(data);

            top_tags = json_data.toptags.tag;
            top_tags_values = [];

            if (top_tags.length > 0) {
            var lng;
            if (top_tags.length>5) {lng = 5;}
            if (top_tags.length<5) {lng = top_tags.length;}
               
            for (i = 0; i < lng; i++) {
            name = json_data.toptags.tag[i].name.replace(/&amp;/g, " \& ");
            top_tags_values.push(name);
                }
            }
           
            fb.trace("Tags:" + top_tags_values);
            objXMLHTTP.Close;
           
          } catch (err) {
          objXMLHTTP.Close;
          }     
       
          if (top_tags_values>"")
          {
          tags = top_tags_values.toString();
          tags = tags.replace(/,/g, "/");
          metadb.UpdateFileInfoSimple("GENRE", tags);
          window.Repaint();
          UpdateTags = "";
          }
}}}


function on_playback_stop() {
    tags = "";
    window.Repaint();
}

function on_mouse_rbtn_up(x, y) {
return true;
}

Try this url: www.youtube.com/watch?fb2k_title=All%20I%20Need&3dydfy_alt_length=217&fb2k_artist=Koffee%20Brown&v=87H4sBbik6s
For me it stops after 10 sec.

Re: foo_youtube

Reply #565
Checked on clean portable install (fb2k 1.3.9b4, WSH 1.5.6, fy_preconf_video 1.11.4). Added URL, opened video window and started playback. All ok, tags were updated, playback (audio and video) has not been interrupted. The same was with my regular config. Can you check on clean installation?

 

Re: foo_youtube

Reply #566
Checked on clean portable install (fb2k 1.3.9b4, WSH 1.5.6, fy_preconf_video 1.11.4). Added URL, opened video window and started playback. All ok, tags were updated, playback (audio and video) has not been interrupted. The same was with my regular config. Can you check on clean installation?


Yes all works fine on clean install.
I reset youtube source page in my config and now it's ok.
No interruptions, even works better then earlier..
I think that this is because of ffmpeg i used, maybe it's too old..
Thank you for this. Sorry i bothered you with no reason..

Re: foo_youtube

Reply #567
Thank you for the great plugin.
I should have known this one earlier.

I have one question about video playing.
When I set the video frame to be palyed "Automatically when the clip starts to play", it plays in a framed window.
The Question is :
When I set it to be played "Manually for each clip", is it possible to play the video in a framed window, not in a web-browser?

Re: foo_youtube

Reply #568
Video playback always goes in framed window. Option "Show video frame" specifies how to show and hide this framed window. 'Manually for each clip' means that not need to show it automatically - you will do this by yourself when you want - but need to hide it automatically after one clip playback was ended. Auto hiding option will be separated in next version from this option, so they become more understandable.

Re: foo_youtube

Reply #569
Video playback always goes in framed window. Option "Show video frame" specifies how to show and hide this framed window. 'Manually for each clip' means that not need to show it automatically - you will do this by yourself when you want - but need to hide it automatically after one clip playback was ended. Auto hiding option will be separated in next version from this option, so they become more understandable.


Thank you for the answer. I find a menu to open the video in a window under the view menu.

I have another question or request.
When there is a CC, I'd like to play the video with CC as a default.
I tried to find if there is any option about this, but unfortunately I failed.
If this is not possible at this moment, could you consider to implement this function in the next release?

Re: foo_youtube

Reply #570
Yes, there are no such option at this moment. I'll add it.

Re: foo_youtube

Reply #571
great feature,thx. i just have 2 questions...

im using the "audio only" version of the plugin, and , speaking of bandwitdh, am i saving it since video is off?

not sure i understood what is m-tags used for, since the files are not stored in my pc i cant use replaygain to set each youtube link, so... will mtags let me set the volume for the entire playlist or per single link or both?  or i totally misunderstood what mtags is?

thx in advance

cheers

Re: foo_youtube

Reply #572
You'll  save bandwidth if video is not enabled.

You  don't need m-TAGS for that. You need to install the EBU R128 Compressor which  applies replay gain on the fly.

Install the R128Norm - EBU R128 Compressor as you would  any component. In preferences\playback\DSP manager add EBU R128 Compressor to the  list of ActiveDSPs.

However,  a better but more complicated way is to use the R128Norm - EBU R128 Compressor in  conjunction with DynamicDSP v2  so that R128Comp kicks in just for tracks lacking  replay gain. You can do it as follows

Install  the DynamicDSP and EBU R128 Compressor components in the usual way.

In preferences\playback\DSP  manager add DynamicDSP to the list of ActiveDSPs. Highlight and click configure  selected. Enter e.g. $if(%replaygain_track_gain%,,R128Comp) titleformat script  in the large textbox at the top of the DynamicDSP configure window; enter the  DSP chain name R128Comp in the little textbox to the left of the "New  Chain" button then click that button; doubleclick the chain name in the  list box and add the EBU R128 Compressor.

There  are some other examples here. This may also be useful if my instructions aren't clear.

The  EBU R128 Compressor automatically matches to the ReplayGain standard 89 dB  using the standard R-128 algorithm and a reasonable look-ahead. The EBU R128  Compressor should be at the top of the DSP chain if other DSPs are included.


Re: foo_youtube

Reply #573
that's very helpful, thanks WilB!

Re: foo_youtube

Reply #574
sorry i couldnt edit last msg.

@WilB the volume is fine, but i need to fix, if possible, the glitch happening at the end of each track. looking at the seekbar i can see it goes silence for 3-4 secs, then it goes back whre the silence began and play it again  till the end of the track.