How can I grab a streaming video manifest from a web page? - shell

Inspired by Christmas, I started writing a Linux shell script that essentially grabs today's episode of the daily children's Christmas show from a TV station's online library. My script does the following:
check how many episodes are already downloaded to identify which is next,
open the TV station's web page for that next episode,
programmatically click in the embedded streaming object to activate the stream,
programmatically click "pause" so it doesn't actually play out loud,
missing: grab the video manifest from the browser,
use the AdobeHDS script to download the fragments and join them into one FLV file,
use avconv to convert the FLV file into a friendlier MP4 format.
Well, my step "5" is broken, and that's where I need your help! My problem is that the manifest file doesn't become available until after the streaming object has been activated, and I don't know how to access that programmatically. Here's my manual workaround:
once the web page loads and the script has clicked on "play", the manifest becomes available,
I use Adblock's "open blockable items" to search for "manifest" in the page's resources,
I manually(!) copy the manifest URL into a shell read prompt. From here, the script continues automatically.
Obviously, this manual step prevents me from setting the script up as a cron task.
Here's a Pastebin snapshot of my script.
Disclaimer: I'm totally new to programming, and I realize that a shell script is not really "programming" but sort-kinda is. I am doing this as an interesting exercise and to learn some basic concepts. You can say it's not mission-critical ;-) but you know how you start doing something, only to realize you need to dig deeper into some detail, and then deeper still, and so on. This is where I am finding myself right now. I didn't expect things to become this complicated, but I guess most programmers have that experience at some point :-)

You can use
HDS Link Detector
to capture this information. Example output
http://drod01c-vh.akamaihd.net/z/all/clear/streaming/ca/547d12116187a20e4c6282ca/Jullerup-Faergeby--3-24-_ecfaae965b3344f2907ebf19d852761a_,1125,562,248,.mp4.csmil/manifest.f4m?g=REZLVPFXIRIX&hdcore=3.5.0&plugin=aasp-3.5.0.151.81

Related

Opening webpage, look for content and give notification once found it

I want to be open up chrome, go to a webpage, and the check that a specific content ie, title, subtitle... is there, and then give me a notification if the content is present, ideally on a loop until it has found it. What is the best way to do that?
I have done a fair amount of this a few years ago, but now I have completely forgotten it all, and I just need help starting up again.
I don't have any software install, (in pretty sure with how basic this is I wont need any).
I have saved a bash file on notepad which I wrote " start www.bbc.com ". This will open up the bbc website, but I don't know how to check for example the title says "Welcome to the BBC". This is just an example, I want to try it on different website, but if I know how to do this then I can change the rest myself. I know how to use inspect element, I just don't know how to implement it in a script.
If there is another software/language thats easier than bash im happy to change over.
I know this sound very trivial and easy, I just want to start off and any help is much appreciated.
Thank you very much

How to use Launchd to run applescript when a music file is opened?

I am having issues with my "Automatically Add to iTunes". As a result, I am trying to make an Applescript that will be stored on my USB, and when I click on a certain Music File, I want it to launch an applescript.
I did some research, and everyone keeps telling me about Launchd. How would I use this command to run an applescript saved as .app? I want to store this Music File and the Applescript on my USB, because I have multiple computers. Can I get it to run as soon as I open a specified music file? Thank you.
I eventually figured out a way to do what I wanted, which was to somehow play a music file from inside the application. All I did was use the idea of resources because it can reference itself without having to rely on a file stored somewhere else on the system. Here's a link to essentially what I did: https://apple.stackexchange.com/questions/157724/applescript-path-to-files-in-applications-resources
in short, I contained the music file within the app itself and played it when it was needed.

Writing a c# or c++ application which can detect if browser is going to download a file

I am going to write an application which runs in the background on windows platform. If user is working on any browser (IE, Firefox, Chrome, etc) and any of the user action results in downloading activity, the background program should take control. The background program pop-ups a window asking user, if they want to download. If user proceeds with OK, then background program sends signal to browser to stop its download process and the background program will do download. If user rejects download by the background program, then default download of browser can go on.
For this please suggest if any working model is there in c#/VB.NET/C++ or how to achieve this activity.
Will very much appreciate your kind help.
Thanking you very much in advance.
I don't think you understand the whole notion of downloading. Any resource you get from the Internet is downloaded. Hence, anything would trigger your application. You can, however, try to "parse" URL to see the extension but this does not have to mean nothing, since you can give any file an arbitrary extension (well not exactly arbitrary, but you know.. ). Another option is detecting FTP downloads ( i assume this might be of more interest ). This way you'd "only" have to check for a specific protocol. The reason i quoted only in the last sentence is that none of these tasks is a simple one.
You basically want to write a Proxy, or use an existing one.
You might wanna take a look at WinPcap
Finally, none of this options really give you the infromation whether user is going to download a file. But if you write a proxy, you could stop the endpoint application of obtaining that file once you download it.

Tool for capturing screenshots in TFS2010 Web Access

I need a tool to capture and attach screenshots in TFS team web access. Instead of having some thrid party tool that captures and saves images on disk and then you have to attach that image to a bug like bugshooting. I want something integrated within TFS.
In VS11 it is possible to copy and paste your screen shots in the description field of the work item. You can check out the VS11 Beta version yourself.
There's nothing integrated in VS, but there are a couple of easy options:
use the standard Windows screenshot function. Alt-PrtScrn will capture the current window, and then you can paste into your work item's Attachments pane. It'll create a generic filename and attach as a PNG.
if you're using Win7, try the "Snipping tool" (just press Start and type "snip" to find it). That will capture a specified area and can then copy it to the clipboard or save to a file. If you copy & paste you still have the problem of generic filenames, though, so personally I still tend to save it myself.
As #Hofman said, you can do it with VS 11 beta, so you can use MS Paint or even SnagIt, for how to do it just see the following link:
http://mohamedradwan.wordpress.com/2012/02/29/new-enhancement-in-mtm-11-preview/
You may want to check the Capture Custom Control - you can use it to embed a "Capture" button in your work items. It automatically attaches the screenshot to your work item.
Check it out at http://witcustomcontrols.codeplex.com/wikipage?title=Screenshot%20controls&ProjectName=witcustomcontrols
there are a very powerful tool which comes with Windows Server 2008 (Actually I'm not sure if it comes with windows 8 or 7)
never-mine.., the tool called "Record Steps To Reproduce the Problems" , this tool built for Taking screenshots of doing any thing in your machine step by step... WOW
You just need to open the start panel and then write "record steps to reproduce a problem". starting record, and make you job that you want, then when you finish stop recording and save the zip file in your machine.
the zip file will expose a word document contains every single click that you make and every page you've open with some description.

How to download a bunch of files from many links on an open browser window?

Okay, this one is hard to classify for me because I don't know the solution yet.
There are these credit card statements that I have to download from my bank's website, but the crazy thing is that they have one separate pdf file for each month - that's like 60 files for last 5 years - and I need to go through all those transactions!
So, being lazy as I am not to just download them one by one, I was wondering if I could write a script or a simple program that can just download these files once I have the browser window open.
Now the key is this - the program cannot directly make an http call to the bank's website, because this window is behind an account authorization screen, after a few clicks to get to credit card statements. What I want to do, is just open the window, and then run some program, and voila, all the files are downloaded.
And just for some super-kicks, it would be awesome if the program could read those pdf files, parse the tables in the pdf and put them into a spreadsheet or something - if someone tells me how to do that in a few hours, you'll get some serious respect and love.. but even the above should be good enough..

Resources