Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed May 7, 2023
1 parent e0f1b78 commit 24014cb
Show file tree
Hide file tree
Showing 43 changed files with 191 additions and 1 deletion.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Periscope Chat Downloader

A simple command-line application that lets you download chat logs of past [periscope](https://www.pscp.tv/) broadcasts.

Accepts a list of broadcast URLs as input, and outputs JSON API responses as provided by Periscope, without
post-processing.

## Getting started

### Java

To run the downloader, you will need Java 8 (or a more recent version). Any Java distribution should work, but
it's been tested with Eclipse Temurin only.

If you don't have any Java version installed locally, I suggest using [sdkman.io](https://sdkman.io/).

### Download the jar

You can download the downloader jar (executable) in a couple of ways:

* Download a pre-built jar from the [Releases page][2]. Latest version: [periscope-chat-downloader.jar][3].
* Download a pre-built jar from the most [recent GitHub Actions artifacts][1]
* Build one locally by running `./gradlew clean shadowJar` in the root of the cloned project,
and run it from the generated `build/libs`.

### Run the jar

Here's how you can run the chat downloader:

```bash
java -jar periscope-chat-downloader.jar broadcasts.txt chatlogs
```

The first argument must be the file that contains a list of broadcast URLs that you want to download chat history for.

Example ([as file](examples/download/broadcasts.txt)):

```
https://www.pscp.tv/ByronBernstein/1lPKqwmwQvAJb
https://www.pscp.tv/ByronBernstein/1gqxvOrDWmnKB
```

The second argument must be the path to the output directory. The directory must not exist.

The paths can be both absolute and relative.

### Example

You see an example of running the downloader, its log output and the output files it generates
in the [examples directory](examples).

## Output files

You can find an example of what this downloader outputs in [examples/download/chatlogs](examples/download/chatlogs).

### Directories:

Each directory represents one broadcast, and the name of the directory is the id of that broadcast.

Within each directory you will find the following files:

* `accessVideoPublic.json` - some general information about the video, this was needed to extract `chat_token`
* `accessChatPublic.json` - some technical information about the chat of this broadcast, contains needed URLs and tokens
* `history-{n}.json` - the chat logs themselves, where each file contains up to 1000 entries. Files are saved
as returned by the Periscope Chat API, without post-processing, and in exactly the same batches and order as if you
watched the whole broadcast from start to finish.

### Root files

* [input.txt](examples/download/chatlogs/input.txt) - list of URLs that were provided to the downloader
* [success.txt](examples/download/chatlogs/success.txt) - list of URLs that were successfully processed and dumped
* [failed.txt](examples/download/chatlogs/failed.txt) - list of URLs the processing of which failed in one way or another

## Version

If you're not sure which version of the downloader you have, you can run it with `-v`:

```text
ignat@workstation> java -jar periscope-chat-downloader.jar -v
##########################################################
### Periscope chat downloader version 1.0.0 ###
### github.com/IgnatBeresnev/periscope-chat-downloader ###
##########################################################
```

[1]: https://github.com/IgnatBeresnev/periscope-chat-downloader/actions?query=branch%3Amaster
[2]: https://github.com/IgnatBeresnev/periscope-chat-downloader/releases
[3]: https://github.com/IgnatBeresnev/periscope-chat-downloader/releases
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions examples/download/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Download example

Chat downloader was run with the following arguments:

```bash
java -jar periscope-chat-downloader.jar broadcasts.txt chatlogs > log.txt
```

* You can inspect the input broadcast file: [broadcasts.txt](broadcasts.txt)
* You can see what it logs in [log.txt](log.txt).
* You can see the output files in [chatlogs](chatlogs)
2 changes: 2 additions & 0 deletions examples/download/broadcasts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://www.pscp.tv/ByronBernstein/1lPKqwmwQvAJb
https://www.pscp.tv/ByronBernstein/1gqxvOrDWmnKB
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"subscriber":"","publisher":"","auth_token":"-","signer_key":"MIIBPzCB7qADAgECAhBLhqKc1s1aS1ZJIrtd5ckJMAoGCCqGSM49BAMCMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzAeFw0xNjA0MjIxOTQ2MjFaFw0xNjA1MjIxOTQ2MjFaMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzBOMBAGByqGSM49AgEGBSuBBAAhAzoABOAmaz/KpIDJiw1x2HYjvZY9HsLyttPOPBJcEjiOK35Id1pTjmnLwqq8YX97+bKzGqRnN4WJETWfoycwJTAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYIKoZIzj0EAwIDQAAwPQIdANIbJvIiiBVkvIUBKg2RpEp1xzuoL1DAD5fcy60CHGptu/TYVpNIdcVfqtMhd2uc8RfmvJA/TgKI4mw=","signer_token":"-","channel":"-","should_verify_signature":false,"access_token":"2Y_AkUJxOYqfrcjoD0fxnYI9cR3FrgO_N6j2IXfJWZAaF_2Y95A_rKLd_rzVmZSYnQVsoPqWkLG1wlc23SZ7kKgLLtrYx-GNUHjWGeLp8A1zWf0BvumrrwahLs9XkTw2MC4HC6XvB5YbUPsbF8tnnp8HXGlMlIbKHyt-eJZpg50GjsjOVX9l0Mu1mQkdxT9rtl1VNehhtonqqfhai4YLTc5XXze5DnIZYVoEToHRe78sPqF_rKll2bSPzfjbgkSL3GsovwK_OZU_nA4SgIwp7sNy1","endpoint":"https://chatman-replay-ap-northeast-1.pscp.tv","replay_access_token":"2Y_AkUJxOYqfrcjoD0fxnYI9cR3FrgO_N6j2IXfJWZAaF_2Y95A_rKLd_rzVmZSYnQVsoPqWkLG1wlc23SZ7kKgLLtrYx-GNUHjWGeLp8A1zWf0BvumrrwahLs9XkTw2MC4HC6XvB5YbUPsbF8tnnp8HXGlMlIbKHyt-eJZpg50GjsjOVX9l0Mu1mQkdxT9rtl1VNehhtonqqfhai4YLTc5XXze5DnIZYVoEToHRe78sPqF_rKll2bSPzfjbgkSL3GsovwK_OZU_nA4SgIwp7sNy1","replay_endpoint":"https://chatman-replay-ap-northeast-1.pscp.tv","room_id":"1gqxvOrDWmnKB","participant_index":0,"read_only":true,"should_log":false,"chan_perms":{"pb":0,"cm":15}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"session":"","replay_url":"https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/hls/DUyT6wdc0-eNTbLNB4AfcoLg56Sa7IcPES8z9-covZXx9ewbP4MiGTqEFk_qbqbZ0DQFER5H1J3MlG9uF3SvAQ/non_transcode/ap-northeast-1/periscope-replay-direct-prod-ap-northeast-1-public/playlist_16939009517762147924.m3u8?type=replay","hls_is_encrypted":false,"lhls_is_encrypted":false,"type":"StreamTypeReplay","media_configuration":"Interleaved","chat_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM1NTYyODgsImFtYmlndW91c191c2VyX2lkIjoiZXlKUWRXSnNhV05WYzJWeVNXUWlPaUozWldJdE9UQmtZbUZtTW1JdE5UYzVNQzAwWmpFNUxUUXpORGt0TUdJNVpXTTFOMkZpT0dZNUluMD0iLCJicm9hZGNhc3RfaWQiOiIxZ3F4dk9yRFdtbktCIiwibG93X2xhdGVuY3kiOmZhbHNlLCJyZWFkX29ubHkiOnRydWUsInBhcnRpY2lwYW50X2luZGV4IjowfQ.B1yZaayyIBs_M49a8oPfAyzGkuqGf7CTxgtM4KHypig","life_cycle_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM1NTYyODgsImJyb2FkY2FzdF9pZCI6IjFncXh2T3JEV21uS0IiLCJjcmVhdGVkIjoxNjgzNDY5ODg4LCJpZ25vcmUiOmZhbHNlLCJwYXJ0aWNpcGFudF9pbmRleCI6MCwiaXNfbGl2ZSI6ZmFsc2UsImlzX2hpZ2hsaWdodHMiOmZhbHNlLCJ0b2tlbl92ZXJzaW9uIjoxfQ.UBtSguVaDfoLHuZQ1zSxxmxFfsTwU-alItPXsNCWNBk","broadcast":{"class_name":"Broadcast","id":"1gqxvOrDWmnKB","created_at":"2017-10-11T14:58:20.798585981Z","updated_at":"2018-07-14T06:00:41.002938792Z","user_id":"644244","user_display_name":"Reckful","username":"ByronBernstein","twitter_id":"492981803","twitter_username":"ByronBernstein","profile_image_url":"https://pbs.twimg.com/profile_images/875919996517482500/XWE1fGEG_reasonably_small.jpg","state":"ENDED","is_locked":false,"friend_chat":false,"private_chat":false,"language":"en","version":44,"start":"2017-10-11T14:58:27.201823081Z","ping":"2017-10-11T15:08:27.587768024Z","end":"2017-10-11T15:09:07.670662896Z","has_moderation":true,"has_location":true,"city":"京都 京都市 上京区","country":"日本","country_state":"","iso_code":"JP","ip_lat":35.02,"ip_lng":135.76,"width":320,"height":568,"camera_rotation":354,"image_url":"https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/ap-northeast-1/periscope-replay-direct-prod-ap-northeast-1-public/eyJkIjowfQ/DUyT6wdc0-eNTbLNB4AfcoLg56Sa7IcPES8z9-covZXx9ewbP4MiGTqEFk_qbqbZ0DQFER5H1J3MlG9uF3SvAQ/chunk_1507734529611709856_313_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWdxeHZPckRXbW5LQiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4ODgsIkdyYW50ZWRUbyI6IndlYi05MGRiYWYyYi01NzkwLTRmMTktNDM0OS0wYjllYzU3YWI4ZjkiLCJTdHJlYW1OYW1lIjoiRFV5VDZ3ZGMwLWVOVGJMTkI0QWZjb0xnNTZTYTdJY1BFUzh6OS1jb3ZaWHg5ZXdiUDRNaUdUcUVGa19xYnFiWjBEUUZFUjVIMUozTWxHOXVGM1N2QVEiLCJleHAiOjE2ODM2NDI2ODh9.KyJKjwnacGsiYSgjNAT4IWW_aP9KfJNGmGC09HqI2pQ\u0026service=proxsee\u0026digest=aq95twhPv86kZ-JOsNVPdHMsnrrFn9hW2XUOrFteBqA","image_url_small":"https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/ap-northeast-1/periscope-replay-direct-prod-ap-northeast-1-public/eyJkIjoxMjh9/DUyT6wdc0-eNTbLNB4AfcoLg56Sa7IcPES8z9-covZXx9ewbP4MiGTqEFk_qbqbZ0DQFER5H1J3MlG9uF3SvAQ/chunk_1507734529611709856_313_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWdxeHZPckRXbW5LQiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4ODgsIkdyYW50ZWRUbyI6IndlYi05MGRiYWYyYi01NzkwLTRmMTktNDM0OS0wYjllYzU3YWI4ZjkiLCJTdHJlYW1OYW1lIjoiRFV5VDZ3ZGMwLWVOVGJMTkI0QWZjb0xnNTZTYTdJY1BFUzh6OS1jb3ZaWHg5ZXdiUDRNaUdUcUVGa19xYnFiWjBEUUZFUjVIMUozTWxHOXVGM1N2QVEiLCJleHAiOjE2ODM2NDI2ODh9.KyJKjwnacGsiYSgjNAT4IWW_aP9KfJNGmGC09HqI2pQ\u0026service=proxsee\u0026digest=aq95twhPv86kZ-JOsNVPdHMsnrrFn9hW2XUOrFteBqA","image_url_medium":"https://prod-fastly-ap-northeast-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/ap-northeast-1/periscope-replay-direct-prod-ap-northeast-1-public/eyJkIjozNjB9/DUyT6wdc0-eNTbLNB4AfcoLg56Sa7IcPES8z9-covZXx9ewbP4MiGTqEFk_qbqbZ0DQFER5H1J3MlG9uF3SvAQ/chunk_1507734529611709856_313_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWdxeHZPckRXbW5LQiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4ODgsIkdyYW50ZWRUbyI6IndlYi05MGRiYWYyYi01NzkwLTRmMTktNDM0OS0wYjllYzU3YWI4ZjkiLCJTdHJlYW1OYW1lIjoiRFV5VDZ3ZGMwLWVOVGJMTkI0QWZjb0xnNTZTYTdJY1BFUzh6OS1jb3ZaWHg5ZXdiUDRNaUdUcUVGa19xYnFiWjBEUUZFUjVIMUozTWxHOXVGM1N2QVEiLCJleHAiOjE2ODM2NDI2ODh9.KyJKjwnacGsiYSgjNAT4IWW_aP9KfJNGmGC09HqI2pQ\u0026service=proxsee\u0026digest=aq95twhPv86kZ-JOsNVPdHMsnrrFn9hW2XUOrFteBqA","status":"chance on tinder","broadcast_source":"bluebird_ios_7.7.2","available_for_replay":true,"is_space_available_for_replay":false,"expiration":-1,"tweet_id":"918128670333534209","tweet_external":true,"media_key":"28_918128641770389504"},"share_url":"https://www.pscp.tv/w/1gqxvOrDWmnKB","autoplay_view_threshold":3}
1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-10.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-11.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"messages":[],"cursor":""}
1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-2.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-4.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-5.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-6.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-7.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-8.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1gqxvOrDWmnKB/history-9.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"subscriber":"","publisher":"","auth_token":"-","signer_key":"MIIBPzCB7qADAgECAhBLhqKc1s1aS1ZJIrtd5ckJMAoGCCqGSM49BAMCMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzAeFw0xNjA0MjIxOTQ2MjFaFw0xNjA1MjIxOTQ2MjFaMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzBOMBAGByqGSM49AgEGBSuBBAAhAzoABOAmaz/KpIDJiw1x2HYjvZY9HsLyttPOPBJcEjiOK35Id1pTjmnLwqq8YX97+bKzGqRnN4WJETWfoycwJTAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYIKoZIzj0EAwIDQAAwPQIdANIbJvIiiBVkvIUBKg2RpEp1xzuoL1DAD5fcy60CHGptu/TYVpNIdcVfqtMhd2uc8RfmvJA/TgKI4mw=","signer_token":"-","channel":"-","should_verify_signature":false,"access_token":"2gDd80Jp3tTeTuJA2uIYCtSu6CMuHeRhg3tXlhuxuPrAhlSa27k7qudT0LQ6YwMQi2oqlPbNrzoxUSvh7RFekNuPlB8Lz9JVo9XRpSetsoOnlc9hMXhgEAFNzZhGGKzUCvfbPP4jc3xL7xJR8htNXY7_3SjtQFobRCysiBJ2qx2puwbW75cVRbfE9B-IC-PXc2Yp3heNWkgFQPCAb2egHyI1KxELED7ONCe3IX5wlUh-2al6o3lu7MavWvbBKCVSzzGXKTt2AsXQCUu4l9g","endpoint":"https://chatman-replay-us-east-1.pscp.tv","replay_access_token":"2gDd80Jp3tTeTuJA2uIYCtSu6CMuHeRhg3tXlhuxuPrAhlSa27k7qudT0LQ6YwMQi2oqlPbNrzoxUSvh7RFekNuPlB8Lz9JVo9XRpSetsoOnlc9hMXhgEAFNzZhGGKzUCvfbPP4jc3xL7xJR8htNXY7_3SjtQFobRCysiBJ2qx2puwbW75cVRbfE9B-IC-PXc2Yp3heNWkgFQPCAb2egHyI1KxELED7ONCe3IX5wlUh-2al6o3lu7MavWvbBKCVSzzGXKTt2AsXQCUu4l9g","replay_endpoint":"https://chatman-replay-us-east-1.pscp.tv","room_id":"1lPKqwmwQvAJb","participant_index":0,"read_only":true,"should_log":false,"chan_perms":{"pb":0,"cm":15}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"session":"","replay_url":"https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/hls/M8A3T5BamZPK7oC_JAnIT_HbkS14VVhxo7cMoOW6W8EJiaQiAEewXdJ9TAEsI959h7S-B2xVq5FJxy5XOcBsZg/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/playlist_16940269982572824670.m3u8?type=replay","hls_is_encrypted":false,"lhls_is_encrypted":false,"type":"StreamTypeReplay","media_configuration":"Interleaved","chat_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM1NTYyNzIsImFtYmlndW91c191c2VyX2lkIjoiZXlKUWRXSnNhV05WYzJWeVNXUWlPaUozWldJdE1qZGxZMlV4WkRRdE16TXdZaTAwTTJNd0xUVXdaVGN0WWpBeVlqaGhORGRrWVRnMkluMD0iLCJicm9hZGNhc3RfaWQiOiIxbFBLcXdtd1F2QUpiIiwibG93X2xhdGVuY3kiOmZhbHNlLCJyZWFkX29ubHkiOnRydWUsInBhcnRpY2lwYW50X2luZGV4IjowfQ.CbqToLfRHG-PvdbCLCkh4BnGgn3UZSVcXCYDZXNKRSs","life_cycle_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM1NTYyNzIsImJyb2FkY2FzdF9pZCI6IjFsUEtxd213UXZBSmIiLCJjcmVhdGVkIjoxNjgzNDY5ODcyLCJpZ25vcmUiOmZhbHNlLCJwYXJ0aWNpcGFudF9pbmRleCI6MCwiaXNfbGl2ZSI6ZmFsc2UsImlzX2hpZ2hsaWdodHMiOmZhbHNlLCJ0b2tlbl92ZXJzaW9uIjoxfQ.EvSYq1hpAXuAUVzw0yFNMjFSHjDY_NRwu1FUvIsQVKw","broadcast":{"class_name":"Broadcast","id":"1lPKqwmwQvAJb","created_at":"2017-09-27T00:56:38.349504611Z","updated_at":"2018-07-14T21:21:36.746417452Z","user_id":"644244","user_display_name":"Reckful","username":"ByronBernstein","twitter_id":"492981803","twitter_username":"ByronBernstein","profile_image_url":"https://pbs.twimg.com/profile_images/875919996517482500/XWE1fGEG_reasonably_small.jpg","state":"ENDED","is_locked":false,"friend_chat":false,"private_chat":false,"language":"en","version":33,"start":"2017-09-27T00:56:46.560441181Z","ping":"2017-09-27T01:01:17.381218352Z","end":"2017-09-27T01:01:32.319305888Z","has_moderation":true,"has_location":true,"city":"Benalmádena","country":"España","country_state":"","iso_code":"ES","ip_lat":36.6,"ip_lng":-4.55,"width":320,"height":568,"camera_rotation":355,"image_url":"https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/us-east-1/periscope-replay-direct-prod-us-east-1-public/eyJkIjowfQ/M8A3T5BamZPK7oC_JAnIT_HbkS14VVhxo7cMoOW6W8EJiaQiAEewXdJ9TAEsI959h7S-B2xVq5FJxy5XOcBsZg/chunk_1506474085408136925_141_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWxQS3F3bXdRdkFKYiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4NzIsIkdyYW50ZWRUbyI6IndlYi0yN2VjZTFkNC0zMzBiLTQzYzAtNTBlNy1iMDJiOGE0N2RhODYiLCJTdHJlYW1OYW1lIjoiTThBM1Q1QmFtWlBLN29DX0pBbklUX0hia1MxNFZWaHhvN2NNb09XNlc4RUppYVFpQUVld1hkSjlUQUVzSTk1OWg3Uy1CMnhWcTVGSnh5NVhPY0JzWmciLCJleHAiOjE2ODM2NDI2NzJ9.7h_qaPFwR8f5Mrd2KHdgm1TBNe6MaMHQOztsSGO5hCo\u0026service=proxsee\u0026digest=E0td8qEY8jMyxGD9EfEVlvZaI13t_tzgdpjyBfjRgfI","image_url_small":"https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/us-east-1/periscope-replay-direct-prod-us-east-1-public/eyJkIjoxMjh9/M8A3T5BamZPK7oC_JAnIT_HbkS14VVhxo7cMoOW6W8EJiaQiAEewXdJ9TAEsI959h7S-B2xVq5FJxy5XOcBsZg/chunk_1506474085408136925_141_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWxQS3F3bXdRdkFKYiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4NzIsIkdyYW50ZWRUbyI6IndlYi0yN2VjZTFkNC0zMzBiLTQzYzAtNTBlNy1iMDJiOGE0N2RhODYiLCJTdHJlYW1OYW1lIjoiTThBM1Q1QmFtWlBLN29DX0pBbklUX0hia1MxNFZWaHhvN2NNb09XNlc4RUppYVFpQUVld1hkSjlUQUVzSTk1OWg3Uy1CMnhWcTVGSnh5NVhPY0JzWmciLCJleHAiOjE2ODM2NDI2NzJ9.7h_qaPFwR8f5Mrd2KHdgm1TBNe6MaMHQOztsSGO5hCo\u0026service=proxsee\u0026digest=E0td8qEY8jMyxGD9EfEVlvZaI13t_tzgdpjyBfjRgfI","image_url_medium":"https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/replay_thumbnail/us-east-1/periscope-replay-direct-prod-us-east-1-public/eyJkIjozNjB9/M8A3T5BamZPK7oC_JAnIT_HbkS14VVhxo7cMoOW6W8EJiaQiAEewXdJ9TAEsI959h7S-B2xVq5FJxy5XOcBsZg/chunk_1506474085408136925_141_a.jpg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbInRodW1iIl0sIkJyb2FkY2FzdElkIjoiMWxQS3F3bXdRdkFKYiIsIkdyYW50VHlwZSI6InJlYWQiLCJHcmFudGVkQXQiOjE2ODM0Njk4NzIsIkdyYW50ZWRUbyI6IndlYi0yN2VjZTFkNC0zMzBiLTQzYzAtNTBlNy1iMDJiOGE0N2RhODYiLCJTdHJlYW1OYW1lIjoiTThBM1Q1QmFtWlBLN29DX0pBbklUX0hia1MxNFZWaHhvN2NNb09XNlc4RUppYVFpQUVld1hkSjlUQUVzSTk1OWg3Uy1CMnhWcTVGSnh5NVhPY0JzWmciLCJleHAiOjE2ODM2NDI2NzJ9.7h_qaPFwR8f5Mrd2KHdgm1TBNe6MaMHQOztsSGO5hCo\u0026service=proxsee\u0026digest=E0td8qEY8jMyxGD9EfEVlvZaI13t_tzgdpjyBfjRgfI","status":"nani is making me periscope","broadcast_source":"bluebird_ios_7.7.2","available_for_replay":true,"is_space_available_for_replay":false,"expiration":-1,"tweet_id":"912843428353933312","tweet_external":true,"media_key":"28_912843388864520193"},"share_url":"https://www.pscp.tv/w/1lPKqwmwQvAJb","autoplay_view_threshold":3}
1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-10.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-11.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-12.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-13.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"messages":[],"cursor":""}
1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-2.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-4.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-5.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-6.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-7.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-8.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/download/chatlogs/1lPKqwmwQvAJb/history-9.json

Large diffs are not rendered by default.

Empty file.
2 changes: 2 additions & 0 deletions examples/download/chatlogs/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://www.pscp.tv/ByronBernstein/1lPKqwmwQvAJb
https://www.pscp.tv/ByronBernstein/1gqxvOrDWmnKB
2 changes: 2 additions & 0 deletions examples/download/chatlogs/success.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://www.pscp.tv/ByronBernstein/1lPKqwmwQvAJb
https://www.pscp.tv/ByronBernstein/1gqxvOrDWmnKB
53 changes: 53 additions & 0 deletions examples/download/log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@


##########################################################
### Periscope chat downloader version 1.0.0 ###
### github.com/IgnatBeresnev/periscope-chat-downloader ###
##########################################################


Starting the download for 2 broadcasts.
Will dump files to /home/ignat/IdeaProjects/periscope-chat-downloader/examples/download/chatlogs
--------------------------
Processing broadcast #1/2; URL: https://www.pscp.tv/ByronBernstein/1lPKqwmwQvAJb
Starting download of broadcast with id 1lPKqwmwQvAJb
-- Getting the chat token
-- Getting chat history credentials
-- Chat history request #0
-- Chat history request #1
-- Chat history request #2
-- Chat history request #3
-- Chat history request #4
-- Chat history request #5
-- Chat history request #6
-- Chat history request #7
-- Chat history request #8
-- Chat history request #9
-- Chat history request #10
-- Chat history request #11
-- Chat history request #12
-- Chat history request #13
Finished downloading files for broadcast 1lPKqwmwQvAJb
--------------------------
Processing broadcast #2/2; URL: https://www.pscp.tv/ByronBernstein/1gqxvOrDWmnKB
Starting download of broadcast with id 1gqxvOrDWmnKB
-- Getting the chat token
-- Getting chat history credentials
-- Chat history request #0
-- Chat history request #1
-- Chat history request #2
-- Chat history request #3
-- Chat history request #4
-- Chat history request #5
-- Chat history request #6
-- Chat history request #7
-- Chat history request #8
-- Chat history request #9
-- Chat history request #10
-- Chat history request #11
-- Chat history request #12
Finished downloading files for broadcast 1gqxvOrDWmnKB
--------------------------
Finished dumping periscope chat history:
* Successfully dumped broadcasts: 2
* Failed: 0
2 changes: 1 addition & 1 deletion src/main/kotlin/me/beresnev/downloader/periscope/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ suspend fun downloadBroadcastChatHistories(

val httpClient = HttpClient(CIO)
broadcastUrls.forEachIndexed { index, broadcastUrl ->
println("Processing broadcast #$index/${broadcastUrls.size}; URL: $broadcastUrl")
println("Processing broadcast #${index + 1}/${broadcastUrls.size}; URL: $broadcastUrl")
try {
val broadcastId = resolveUrlToId(broadcastUrl)
SingleBroadcastChatDownloader(
Expand Down

0 comments on commit 24014cb

Please sign in to comment.