Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook live videos cannot be played using www.facebookcorewwwi.onion domain #2164

Closed
1 task done
emanruse opened this issue Nov 13, 2018 · 3 comments
Closed
1 task done
Labels
plugin enhancement A new feature for a working Plugin

Comments

@emanruse
Copy link

  • This is a plugin issue and I have read the contribution guidelines.

Facebook live videos cannot be played if they use the www.facebookcorewwwi.onion domain, e.g. https://www.facebookcorewwwi.onion/somepage/videos/video_id which is a valid URI playing fine in browser (using Tor proxy).

Reproduction steps / Explicit stream URLs to test

streamlink --player=mpv --http-proxy socks5h://127.0.0.1:9050/ --https-proxy socks5h://127.0.0.1:9050/ --rtmp-proxy socks5h://127.0.0.1:9050/ https://www.facebookcorewwwi.onion/somepage/videos/video_id best

Log output

error: No plugin can handle URL: https://www.facebookcorewwwi.onion/somepage/videos/video_id

Additional comments, screenshots, etc.

Replacing facebookcorewwwi.onion with facebook.com makes the above command line work fine (through Tor).

@beardypig
Copy link
Member

In theory it should be easy to support, I assume you are using the --http-proxy and --https-proxy options to set the proxies to your Tor socks proxy?
I don't use Tor so I cannot test it, but the patch should be as simple as

diff --git a/src/streamlink/plugins/facebook.py b/src/streamlink/plugins/facebook.py
index 537b4a5a..7dedad51 100644
--- a/src/streamlink/plugins/facebook.py
+++ b/src/streamlink/plugins/facebook.py
@@ -7,7 +7,7 @@ from streamlink.utils import parse_json


 class Facebook(Plugin):
-    _url_re = re.compile(r"https?://(?:www\.)?facebook\.com/[^/]+/(posts|videos)")
+    _url_re = re.compile(r"https?://(?:www\.)?facebook(?:\.com|corewwwi\.onion)/[^/]+/(posts|videos)")
     _src_re = re.compile(r'''(sd|hd)_src["']?\s*:\s*(?P<quote>["'])(?P<url>.+?)(?P=quote)''')
     _playlist_re = re.compile(r'''video:\[({url:".+?}\])''')
     _plurl_re = re.compile(r'''url:"(.*?)"''')

@beardypig beardypig added the plugin enhancement A new feature for a working Plugin label Nov 14, 2018
@emanruse
Copy link
Author

In theory it should be easy to support, I assume you are using the --http-proxy and --https-proxy options to set the proxies to your Tor socks proxy?

As listed in the OP.

The fix you suggest works. Perhaps it should be noted that these are also valid domains:

mbasic.facebook.com
m.facebook.com
mbasic.facebookcorewwwi.onion
m.facebookcorewwwi.onion
*.fbcdn23dssr3jqnq.onion (the CDN used by facebookcorewwwi.onion)

in case you would like to extend the regex to support these too. The m.* and mbasic.* are particularly good for TOR users as they allow using FB without JS. Although there aren't really any live videos in them for the moment (AFAIK) copying the URL of a non-live video and giving it to streamlink is still useful (e.g. to play in a more feature rich player rather than in browser) - currently that is possible with facebook.com.

@emanruse
Copy link
Author

Actually it seems possible to see there is a live video on m(basic).* but opening the post with it (link looks like https://mbasic.facebookcorewwwi.onion/videos/live/m/redirect/<some_id>/ says:

Please View in the Facebook App
Sorry, live video can't play in this browser. To see this video, watch it on the Facebook app.
[Open Facebook] (button)

and below it there is a big thumbnail with the red "Live" icon and a round Play button. Refreshing the page refreshes next frames from the video.

Looking at the HTML code reveals that the Play button is an anchor with href:

intent://video/?id=%7B<the_id_from_above>%7D&ref=msite%2F#Intent;scheme=fb;package=com.facebook.katana;end

Clicking that suggest an xdg-open (on Linux) but there is no program associated with that:

Could not find any application or handler for intent://video...

That of course may be filed in a separate issue but I thought I should mention it. It would be good if streamlink can extract the proper link and give it to a player.

Billy2011 pushed a commit to Billy2011/streamlink-27 that referenced this issue May 14, 2020
…eamlink#2286)

Immediate playback for DASH streams with separate audio and video
streams will not be supported until proper SegmentBase handling is
implemented.

closes streamlink#2133
closes streamlink#2164
closes streamlink#2324

WIP for streamlink#2168
mkbloke pushed a commit to mkbloke/streamlink that referenced this issue Aug 18, 2020
…eamlink#2286)

Immediate playback for DASH streams with separate audio and video
streams will not be supported until proper SegmentBase handling is
implemented.

closes streamlink#2133
closes streamlink#2164
closes streamlink#2324

WIP for streamlink#2168
resiproxy pushed a commit to resiproxy/streamlink that referenced this issue Nov 5, 2020
…eamlink#2286)

Immediate playback for DASH streams with separate audio and video
streams will not be supported until proper SegmentBase handling is
implemented.

closes streamlink#2133
closes streamlink#2164
closes streamlink#2324

WIP for streamlink#2168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin enhancement A new feature for a working Plugin
Projects
None yet
Development

No branches or pull requests

2 participants