54ac/stream-detector

Question about filenames.

54m4d opened this issue · 26 comments

54m4d commented

Hi

I have always used this extension to do th emost basic thing which is to obtain stream links, but now i don't want to have the downloaded media to have the default random long filenames anymore.

Almost always, the tab title is the preferred name that i'd like to have/use, could you kindly advise me how the media files can be obtained with the tab title as default instead of the random name?

There is an option called use tab title as filename i checked this but it didn't make any difference, maybe it's meant to be used with something else..

54ac commented

Use tab title as filename works in tools such as yt-dlp and ffmpeg. It will use the source column as the filename. If no source tab title is detected for a particular file then that option gets ignored.

54m4d commented

Is it enough to just enable it or does go along with user command?

54ac commented

As mentioned, it works with the yt-dlp and ffmpeg options. If you want to use it in a user-defined command, use the %tabtitle% field instead.

54m4d commented

Thanks
So this is what i want to use, but when copied, i just get this: --save-name %tabtitle%

image

54ac commented

You're supposed to include an entire command there, not just the arguments. It's not related to the existing tools or options. E.g. ffmpeg -i "%url%" -c copy "%tabtitle%.ts". Therefore I think it's easier to use the built-in ffmpeg or yt-dlp options with the Use tab title as filename option checked.

54m4d commented

I also tried it Use tab title as filename and it works, but since i'm using a preconfigured batch file, it only asks for the link and after that it asks for one argument. So in the extension i was thinking to do 2 steps, 1. copy the link and paste in the bat, 2. copy second argument which is --save-name %tabtitle% and paste in the bat file, that would give us a file downloaded with the correct tab title.

I think it would be an added value to also let the user defined command copy the arguments as in the screenshot for more flexibility, would definitely be nice to see this supported, or mabe a checkbox to enable this function, any thoughts?

Thanks!

54ac commented

Why are you using a batch file? Simply use the commands generated by the addon. Seems more straightforward and you only need to copy one thing.

I think it would be an added value to also let the user defined command copy the arguments as in the screenshot for more flexibility, would definitely be nice to see this supported, or mabe a checkbox to enable this function, any thoughts?

I aim to keep the addon basic and simple to minimize the chance of random things breaking, so I'd rather not add functionalities at this stage unless it's really necessary. The user-defined commands are left for the user to manage, the addon manages the built-in commands. That being said, you could set your user command to only contain the arguments you need, then copy the entries by first copying the URL and then switching to user command and copying that entry again. Though that sounds like a tedious process.

54m4d commented

I'm all in for the simplicity of this tool, and that's reason number one i have taken it in use, nice to hear that the goal is to stay as basic and lightweight as possible.

Why are you using a batch file? Simply use the commands generated by the addon. Seems more straightforward and you only need to copy one thing.

I use bat files just for organizational purposes, like download location and some other commands that are faster to use from batch file than the extension.

you could set your user command to only contain the arguments you need, then copy the entries by first copying the URL and then switching to user command and copying that entry again. Though that sounds like a tedious process.

Yes, that's what i tried but sadly didn't work, let's take this example:

This is what the simplified bat file is asking:

N_m3u8DL-RE

1. Video link?: hw-cdn.freestreaming.com/leaf/1048.m3u8 (Regular Copy)
2. Download location?: skip
3. More arguments?: --save-name %tabtitle% (User command)

The only issue is in step 3 where we want a real tab titile rather than %tabtitle%.

Since i'm using a bat file, it takes only 2 pastes before the download starts, well only if step 3 has a real tab title though :)

Otherwise i will try to fiddle and see how closer i can get to the desired result.

54ac commented

The only issue is in step 3 where we want a real tab titile rather than %tabtitle%.

That's because your bat file doesn't know what the tab title is - what I'm saying is, perform the regular copy, then switch to the user command (containing --save-name %tabtitle% in the options) and copy the entry again (not the command - click on the file you want to apply the arguments to). This should fill in the tab title which you can then paste into your more arguments step.

But, again, that seems very tedious. To me, the whole point of the addon is to eliminate the need for any batch files like this. If you need personalized commands, I'd recommend switching to user-command presets entirely. That way you could cut it down to just 1 paste.

54m4d commented

That's because your bat file doesn't know what the tab title is - what I'm saying is, perform the regular copy, then switch to the user command (containing --save-name %tabtitle% in the options) and copy the entry again (not the command - click on the file you want to apply the arguments to). This should fill in the tab title which you can then paste into your more arguments step.

Ah, got it now, tested it and it's definitely a bit tedious yes, what about Use regex in user-defined command: would that help in this case?

54ac commented

I'm not sure how regex would be relevant to your needs. %tabtitle% already does what you're asking without the need for regular expressions. All of this is explained in the question marks in the options when you hover over them.

54m4d commented

I see, but i'm very sorry if i still don't get it, because now i have just tried your example ffmpeg -i "%url%" -c copy "%tabtitle%.ts" and the downloaded video is named %tabtitle%.ts.

The %url% get's replaced with the actual url and that's ok, %tabtitle% doesn't, so the question is when does the %tabtitle% get replaced with the actual tab title?

I'm talking about the User-defined commands, not the dedicated ones.

54ac commented

I tried replicating this: entered ffmpeg -i "%url%" -c copy "%tabtitle%.ts" into the User-defined command 1 field, selected Copy stream URL as: User-defined command 1, tried copying an entry with the Source field present. It worked fine and replaced the fields with the URL and tab title in the command before copying the command, which can then be pasted into the terminal. Obviously ffmpeg isn't going to know what %tabtitle% itself means. If %tabtitle% is not being replaced, maybe you are trying to copy an entry without the Source field present?

I'm talking about the User-defined commands, not the dedicated ones.

Not sure what you mean by a dedicated command.

54m4d commented

It's very strange, i mainly use Chromium, but i tried Firefox now too and it's still doesn't replace %tabtitle%.

Not sure what you mean by a dedicated command.

I just mean Copy stream URL as: commands of ffmpeg, yt-dlp, etc... in the list.

Let's take this demo, could you please try it and see if it gets replaced here on Bitmovin?

For me it didn't get replaced, i have the tab title present as the source field, also, i think even if the tab title is not present, it will just copy whatever source there is anyway as long as it's not blank.

54ac commented

Let's take this demo, could you please try it and see if it gets replaced here on Bitmovin?

Works fine for me:
ffmpeg -i "https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd" -c copy "DRM Secure Stream Test using HTML5 Video Player _ Bitmovin.ts"

No clue why it doesn't work for you.

54m4d commented

That is very strange indeed, could it be my settings are misconfigured? can i provide a screenshot?

54ac commented

Maybe, I'm not sure. I'd simply reset settings and start from scratch if I were you.

54m4d commented

No clue why it doesn't work for you.

I found the issue, please try it again with Include additional headers unchecked and tell me what you notice.

54ac commented

You're right, that's interesting. Thanks for letting me know, I'll look into it and hopefully fix it for the next version.

54m4d commented

And maybe my last question, speaking of bitmovin demo, the first time i visit it, i get the number 1 as an indication on the icon, and if i refresh the page, it disappears, and when i click the icon, there is nothing in the current tab until i switch to the current session on the right, is this expected?

image

image

54ac commented

Yes, it's technically a different page once it gets refreshed.

54m4d commented

Yes, it's technically a different page once it gets refreshed.

Ah i see, but this behaviour was not in the 4-5 previous versions, coz i can't remember it was like this, right?

54ac commented

Actually, I wasn't entirely right: if you simply refresh the page without e.g. closing the tab and opening a new one, it should still count as the current tab. The number of detections on the icon gets reset once you open the menu, not when you refresh the page.

54m4d commented

I can confirm this, now i don't know what is right or wrong, but in my opinion i think it's more convenient if doesn't dissapear from the current tab when we close and open new tabs, otherwise it ends up at the bottom of the current session, so we have to scroll a bit if there's a lot of links. but this isn't a big issue at all for now.

54ac commented

i think it's more convenient if doesn't dissapear from the current tab when we close and open new tabs

I don't think it ever worked that way, unless Firefox changed how it assigns tab IDs. I haven't really changed any code in regard to that.

I hope we've finally resolved all your issues after 4 hours on a Saturday :)

54m4d commented

Thanks for your good support.