Pmmlabs / OpenPeriscope

Unofficial Periscope client
GNU General Public License v2.0
74 stars 30 forks source link

Automatic Download of private broadcasts no longer works #123

Closed MarcosSyd closed 5 years ago

MarcosSyd commented 5 years ago

OpenPeriscope is only working on open broadcasts :(

MarcosSyd commented 5 years ago

"Unable to open key file" ; "Error when loading first segment"

MarcosSyd commented 5 years ago

crypto+https://prod-fastly-sa-east-1.video.periscope.tv/ (CRYPTO) LoL :(

ghost commented 5 years ago

really need your help! Please don't disregard

Bramengton commented 5 years ago

I confirm:

Unable to open key file https://api.periscope.tv/api/v2/hlsEncryptionKey?stream_name=eEKNz4mDvd6hTXCShiLzx93b5oLqcjT6xxevBijZQd90_ZeHUgkrC6CAsGpqRxFDl222JBuRHEmS8qkdvwX7hg
[hls,applehttp @ 0x1d70440] Failed to open segment of playlist 0
alfabetico commented 5 years ago

Any news guys?

KaMyKaSii commented 5 years ago

I believe that the download of private transmissions (in progress) is still working in My-OpenPeriscope. Unfortunately the partial/full private replay download no more, I think there was some change on periscope server side https://github.com/gitnew2018/My-OpenPeriscope

alfabetico commented 5 years ago

the download in progress does not work on https://github.com/gitnew2018/My-OpenPeriscope

Osperye commented 5 years ago

I have been using "My-OpenPeriscope" fork for some months and I can confirm that now it only creates new empty folders when somebody shares a private. Clicking on Download when the private is in progress also produce the same result in my experience. Trying to watch the live private results in a "user was live" window, even if the user is still broadcasting.

I am not an expert but some guy told me periscope changed the stream flux for privates from HLS to something else (m2ts?). Not sure if this is true. I hope it get fixed as this is the only tool that does everything automatically... Everything else requires you to be there to start the download. Not sure if the author/s are still into it or not. At the moment the only way I know to record private streams (apart for screen recorders) is to use snagscope (which had the same problem, but it has been fixed).

alfabetico commented 5 years ago

Yes, but snagscope work only in android device. You know an app for iOS?

KaMyKaSii commented 5 years ago

The Snagscope developer explained to me what happened, maybe some more experienced user here can use the explanation to fix OpenPeriscope

Basically, what Periscope did is they added AES-128 encryption to their private broadcasts. This means when you download the mpeg-ts segment files they are encrypted and you need to decrypt them before they can be played, or merged into a single .ts file. To decrypt the segment files you need to grab the encryption key and initialization vector from the m3u8 playlist. If you look at the playlist for a private broadcast, you will see a line above the file segment that now contains the encryptionKeyUri and IV. The encryption key is the same for each segment file, but the IV is different for each file. You need to save the key and use it, together with the IV, to decrypt each segment file. In Snagscope, I save all the downloaded files into this directory (sub-directory for each broadcast): /storage/emulated/0/Android/data/com.iqtecture.app.snagscope/files In this directory you'll see that there is a file named encrypt.key. This is the byte[] downloaded from the encryptionKeyUri endpoint. There is also a file named "duration.list". This file contains the length(time) of each of the segment files as well as the init vector (IV) for each of the segments. We use this information to decrypt the downloaded segment files and then rename the originals to "xxx.ts.encrypted".

Osperye commented 5 years ago

Thanks @KaMyKaSii, this is quite important information, hopefully somebody manages to fix it.

@alfabetico yes unfortunately to use snagscope you need an emulator like bluestacks or similar. It requires a bit of setup make sure streams are saved in the shared folder. It is doable, but still not as handy as openperiscope since it requires the user to be there to initiate downloads.

kewalsk commented 5 years ago

I've created small fix for private broadcasts in my fork and the pull request for it, but I don't know if @Pmmlabs is still maintaining this project, because there are 3 other pull requests pending since March last year. Thanks to @KaMyKaSii and the Snagscope developer for some suggestions, but actually it was much simpler than I expected. The ffmpeg is doing all work.

KaMyKaSii commented 5 years ago

@kewalsk i'm glad you fixed the issue, thank you! Sorry for the request, but do you think you could do the same in My-OpenPeriscope? I think it is a more complete version than the original OpenPeriscope, and it works better because I use it as userscript on Android. Thank you one more time!

kewalsk commented 5 years ago

As I can see the My-OpenPeriscope is not using ffmpeg but processing the playlist itself with downloaderNode.js. I'm sure it can be fixed also by adding necessary cookie but it will not help to decrypt the video. The decryption is done by ffmpeg. It could be also programmed from scratch as the Snagscope and Periscope itself are doing (both in Java), however I'm not sure it will be efficient to do it in JavaScript. I'm not really JavaScipt programmer to be able to add it, sorry.

KaMyKaSii commented 5 years ago

@kewalsk I understand. But then could you consider adding the following features in your fork?

  1. Auto update thumbnails
  2. Download links of partial replays
  3. Update these download links (both to achieve partial replay and to achieve full replay) automatically Screenshot_20190509-170417_1 Screenshot_20190509-170444_1 All of these features are present in My-OpenPeriscope, which is why I find it more complete than the original OpenPeriscope. And "FFMPEG live/partial replay/full replay" buttons that copy all the needed information to clipboard into the format required for ffmpeg (ffmpeg + header + link + parameters + output) would be nice because I could use your fork to get the download information and Termux (a terminal environment app) to run ffmpeg and download it. I'm really sorry for bothering you with this, but if you can do it, I'll be very grateful. All in your time, of course
kewalsk commented 5 years ago

Sure I will think about it. Regarding the partial replays: Is anyone successful with downloading replay of running private broadcast to catch it from the beginning?

KaMyKaSii commented 5 years ago

Sure I will think about it. Regarding the partial replays: Is anyone successful with downloading replay of running private broadcast to catch it from the beginning?

Thank you! And yes, that's what I did before with My-OpenPeriscope. To get partial replay (either of public or private live) you must do the following request: https://api.periscope.tv/api/v2/accessVideoPublic?broadcast_id=LiveIDHere&replay_redirect=false&latest_replay_playlist=true And then you will be redirected to the playlist.m3u8 link that contains the beginning of the transmission until the moment the request was made. And it works (for around 24h) even if the transmission is deleted by the user or banned by the moderators

Kamouser commented 5 years ago

Hello @KaMyKaSii in which place would go the link ''https://api.periscope.tv/api/v2/accessVideoPublic?broadcast_id=LiveIDHere&replay_redirect=false&latest_replay_playlist=true'' for partial direct? Inside a .js file or where?

kewalsk commented 5 years ago

I think we should move the conversation about My-OpenPeriscope to the issue in that project - #13.

KaMyKaSii commented 5 years ago

Hello @KaMyKaSii in which place would go the link ''https://api.periscope.tv/api/v2/accessVideoPublic?broadcast_id=LiveIDHere&replay_redirect=false&latest_replay_playlist=true'' for partial direct? Inside a .js file or where?

As a user, it will depend on how you access OpenPeriscope. In my case I use OpenPeriscope as userscript on a Chromium browser, so as it is already connected in my Periscope/Twitter and has the required authentication cookies and etc, I just need to find out the ID of the transmission in question and put it in the value of "broadcast_id"on the link I provided, then simply paste it into the address bar and press enter. Public broadcasts have the ID publicly on they link (pscp.tv/somerandomstring), so you do not need to be logged in to Periscope/Twitter to have a valid result when trying to access the partial replay link. You need to be logged in to discover the ID of private broadcasts, but if I'm not mistaken OpenPeriscope shows you the ID on the UI

I think we should move the conversation about My-OpenPeriscope to the issue in that project - #13.

That's fine with me, but I do not quite understand why 😅

kewalsk commented 5 years ago

@KaMyKaSii just as you wrote about My-OpenPeriscope, it is "more complete than the original OpenPeriscope" and I can agree to that. I'm not going to copy functionality between these projects because I'm using OpenPeriscope only occasionally and not for downloading broadcasts. I think I can invest some time to add a features to My-OpenPeriscope instead.

Kamouser commented 5 years ago

As a user, it will depend on how you access OpenPeriscope. In my case I use OpenPeriscope as userscript on a Chromium browser, so as it is already connected in my Periscope/Twitter and has the required authentication cookies and etc, I just need to find out the ID of the transmission in question and put it in the value of "broadcast_id"on the link I provided, then simply paste it into the address bar and press enter. Public broadcasts have the ID publicly on they link (pscp.tv/somerandomstring), so you do not need to be logged in to Periscope/Twitter to have a valid result when trying to access the partial replay link. You need to be logged in to discover the ID of private broadcasts, but if I'm not mistaken OpenPeriscope shows you the ID on the UI

I worked for the public broadcast, but for the private does not work says: {"Success": false, "MSG": "Not Found"}

kewalsk commented 5 years ago

@Kamouser there could be 2 reasons: you trying to call public api for private broadcast or the broadcast was already deleted.

Pmmlabs commented 5 years ago

Hi guys, thank you for solving the problem. I've merged kewalsk's fix, and I think I will merge other critical bugfixes, if any. But since I'm not using OpenPeriscope, I'm not following it's updates and not interested in new features, so I'm glad that there are forks, maybe I'll put a link to something in the readme.

alfabetico commented 5 years ago

will be released a new pre-build version?

Crvg1898 commented 5 years ago

please,

can someone help openperiscope, re-record private lives

Pmmlabs commented 5 years ago

Version with fix has been released https://github.com/Pmmlabs/OpenPeriscope/releases/tag/v1.9