Start video stream automatically

01/23/2016 00:26 C_O_R_E#1
Hey guys,

I'm currently interested in a programm, whom starts video stream automatically. I'm skilled in C/C++ but currently a newbie in network programming. Anyway, I'm looking for a programming lanuage, which fits perfectly into this and handle web things easily.


I really love to watch some series (probably not allowed to post the url).
The website offers several links to different hosters. The hoster I prefer is streamcloud.
This is what I want to implement:
- Open the series, you want to watch.
- Choose the prefered hoster.
- Click on url to get refered to hoster/stream.
- Wait for the countdown and click on web button.
- Start video and set it on fullscreen mode.


It sounds easy, but I don't know which programming language I should use for it.
I would like to use Python. Found some useful entries like:
-http://wwwsearch.sourceforge.net/mechanize/
Using mechanize for pressing web buttons.


Does someone have links and ideas, how to realize my little project?
01/23/2016 11:46 noahrmal#2
take a look at the media center software "Kodi". There are addons (written in python) which exactly do what you described.
01/23/2016 12:21 .SkyneT.#3
Because there is a lot of Javascript involved I would recommend looking into selenium.
Selenium can make use of many different Browsers through different WebDrivers. I would recommend using Chrome or Firefox.

You can install selenium via pip:
Code:
pip install selenium
For Chromedriver just download the .exe from [Only registered and activated users can see links. Click Here To Register...]and add it to your PATH.

If you need to parse some HTML (which you probably will) you can use BeautifulSoup for that. You can install it via pip aswell:
Code:
pip install beautifulsoup4
01/23/2016 13:31 C_O_R_E#4
Quote:
Originally Posted by 123klo View Post
take a look at the media center software "Kodi". There are addons (written in python) which exactly do what you described.
I'm using gentoo & arch on my notebooks, where I want to implement applications by myself. Maybe on my win computer. I will think about it...


Quote:
Originally Posted by .SkyneT. View Post
Because there is a lot of Javascript involved I would recommend looking into selenium.
Selenium can make use of many different Browsers through different WebDrivers. I would recommend using Chrome or Firefox.

You can install selenium via pip:
Code:
pip install selenium
For Chromedriver just download the .exe from [Only registered and activated users can see links. Click Here To Register...]and add it to your PATH.

If you need to parse some HTML (which you probably will) you can use BeautifulSoup for that. You can install it via pip aswell:
Code:
pip install beautifulsoup4

Jap, I just checked it and you're right.
I have visited the website of selenium and its quite interesting for the thing I want to build. It also have an active community. I joined the irc channel to get some reviews about selenium.




Also checked BeatifulSoup. Why do I need it? It's pulling data out of a html file/code. The only reason why I need that is to grab url from the html document. Does selenium not also do that?
Selenium can search for defined elements like href and returns the value of it. Anyway, a big thanks to you to referring me to it. I will work on it.
01/23/2016 13:43 .SkyneT.#5
Quote:
Originally Posted by C_O_R_E View Post
Also checked BeatifulSoup. Why do I need it? It's pulling data out of a html file/code. The only reason why I need that is to grab url from the html document. Does selenium not also do that?
Selenium can search for defined elements like href and returns the value of it. Anyway, a big thanks to you to referring me to it. I will work on it.
That's actually true, I totally forgot that selenium is able to do that on it's own :D
01/23/2016 16:34 warfley#6
I did something similar once and used the libvlc to stream the media. Made this in free pascal with the vlc Lazarus component but there should also be a python or c++ wrapper for it (I know there is at least a non oop wrapper for c)
02/25/2016 01:07 C_O_R_E#7
I didn't update for a while and just wanted to let you know, that I finished this "little project thing".
I have written my exams (kinda pressured my little projects) and passed them successfully.

So I have some goals in the 2nd semester and also want to learn/practice Python in my semester break.


Also have written in Python via Selenium/Webdriver API my QIS. (QIS shows my exam results university homepage)


Thanks for the recommendation of selenium. Great community.