Comments (6)
You are trying to pass a playlist to a method that expects a variant playlist (a playlist which links to varying quality playlists).
stream = HLSStream(self.session, playlisturl)
Is the way you want to use it.
from livestreamer.
Thanks @chrippa,
Just made the changes, but it seems there is an issue with relative url's.
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o//hls/7zlyq17szhc0o0wwsg4o/6321.ts
athoik@pc:/tmp/livestreamer$ livestreamer -l debug http://streamingvideoprovider.co.uk/dymuc8e7d9cg best
[cli][info] Found matching plugin streamingvideoprovider for URL http://streamingvideoprovider.co.uk/dymuc8e7d9cg
[plugin.streamingvideoprovider][info] http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/index.m3u8
[cli][info] Opening stream: best
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o//hls/7zlyq17szhc0o0wwsg4o/6321.ts
[cli][error] Failed to read data from stream
Here is my plugin:
from livestreamer.stream import HLSStream
from livestreamer.plugins import Plugin, PluginError, NoStreamsError
from livestreamer.utils import urlget
from time import time
import re
class Streamingvideoprovider(Plugin):
HLSStreamURL = "http://player.webvideocore.net/index.php?l=info&a=ajax_video_info&file={0}&rid={1}"
@classmethod
def can_handle_url(self, url):
return "streamingvideoprovider.co.uk" in url
def _get_streams(self):
channelname = self.url.rstrip("/").rpartition("/")[2].lower()
unixtime = str(int(time()))
try:
res = urlget(self.HLSStreamURL.format(channelname, unixtime))
PlaylistURL = re.search("'(http://.+\.m3u8)'", res.text).group(1)
self.logger.info(PlaylistURL)
streams = {}
streams['best'] = HLSStream(self.session, PlaylistURL)
except IOError:
raise NoStreamsError(self.url)
return streams
__plugin__ = Streamingvideoprovider
from livestreamer.
Should be fixed with 4f72bfc.
I have not documented the plugin stuff so you couldn't know this but please don't name the stream "best", it's reserved and added automatically. When the quality does not have a name most plugins use "live" instead.
from livestreamer.
Hello,
When a url in m3u8 starts with / we must use the network location.
from urlparse import urlparse
...
def _relative_url(self, url):
if not url.startswith("http"):
if url.startswith("/"):
return "http://{0}{1}".format(urlparse(self.url).netloc, url)
else:
return "{0}/{1}".format(os.path.dirname(self.url), url)
else:
return url
With the above change streaming works. But after a while an error 500 arrives and streaming stops.
[cli][error] Error when reading from stream: Unable to open URL: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/21.ts (500 Server Error: Internal Server Error)
athoik@pc:/tmp/livestreamer$ livestreamer -l debug http://streamingvideoprovider.co.uk/dymuc8e7d9cg best
[cli][info] Found matching plugin streamingvideoprovider for URL http://streamingvideoprovider.co.uk/dymuc8e7d9cg
[plugin.streamingvideoprovider][info] http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/index.m3u8
[cli][info] Opening stream: best
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/18.ts
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/19.ts
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/20.ts
[stream.hls][debug] Next entry: <requests.packages.urllib3.response.HTTPResponse object at 0xa4ea1ac>
[cli][info] Starting player: vlc --file-caching=5000
[cli][debug] Writing stream to output
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x8663908] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Got bus address: "unix:abstract=/tmp/dbus-xEXxdPjXBO,guid=01df72f52903cd991262d7940000002f"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-xEXxdPjXBO,guid=01df72f52903cd991262d7940000002f"
Registered DEC: true
Registered event listener change listener: true
[0xb541fc08] ts demux error: MPEG-4 descriptor not found
[0xb4d4ac40] packetizer_mpeg4audio packetizer: AAC channels: 2 samplerate: 22050
[stream.hls][debug] Next entry: <requests.packages.urllib3.response.HTTPResponse object at 0xa4eaf2c>
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Next entry: <requests.packages.urllib3.response.HTTPResponse object at 0xa4ea78c>
[stream.hls][debug] Opening fd: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/21.ts
[cli][error] Error when reading from stream: Unable to open URL: http://hls1.webvideocore.net/hls/7zlyq17szhc0o0wwsg4o/21.ts (500 Server Error: Internal Server Error)
[cli][info] Stream ended
Is this ok?
Maybe when the http error code, return by the server is 500 the streaming should continue to the next entries?
EDIT: Just show the commit 4f72bfc urljoin one-liner +1
EDIT2: Thanks for the "live" tip. I did already the change on the plugin. Soon i will fork in order to push it properly. :)
from livestreamer.
Hmm, this is strange, livestreamer only tries to open segments that are available in the playlist, so this means that the server lists a file that may not be available yet. :-/ cb4cfc8 handles this nicer though.
from livestreamer.
It is strange, i believe continuing to the next entries might be better.
Probably i will open open a new issue to discuss behaviour of HLS on streamingvideoprovider.
There is no issue with EXT-X-STREAM-INF. (mea culpa)
from livestreamer.
Related Issues (20)
- Need a new twitch.py plugin. Who can do it? HOT 2
- Just Happened Yesterday | Chaturbate Plugin Issue HOT 6
- REMINDER: Livestreamer is abandoned, use streamlink:
- Plugin Support For arconaitv.us
- streamlink issues
- Cannot start from systemd HOT 3
- In need of a camsoda plugin
- please add support for steam livestreams
- `docs.livestreamer.io` SSL error
- When streamplay, powvideo...?
- This vidio is sub-only! Twitch removed the ability for 3rd software to download such vidios,sorry.
- Please mention working fork in README.
- Not working HOT 2
- i need faking viewers on Twitch. Kann mir jemand helfen mit der APP?
- Fresh windows install. No output from command line HOT 2
- how to integrate in a .NET C# app
- plugin request : tango.me
- Plugin request: "Skyline webcams" support
- PROJECT IS NO LONGER MAINTAINED (since years)
- Doesn't actually work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livestreamer.