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

Claim moments #182

Closed
silentguy256 opened this issue Mar 3, 2023 · 11 comments
Closed

Claim moments #182

silentguy256 opened this issue Mar 3, 2023 · 11 comments
Assignees
Labels
🧱 enhancement New feature or request 🙋‍♂️ help wanted Extra attention is needed

Comments

@silentguy256
Copy link

I have not noticed any of my followed streamers use moments yet but I've seen people talk about them occasionally. They are described here: https://help.twitch.tv/s/article/moments

It seems this is a feature for "having been there when it happened" so it seems there is no need to consider them during priority etc, we would "just" need the ability to notice if there was a moment in one of the streams currently being farmed and if there was claim it within 180 seconds.

In essence it would be like claiming the regular bonus points but I have no idea how similar it would be in the backend, I have not quite understood the api interactions

@rdavydov rdavydov self-assigned this Mar 6, 2023
@rdavydov rdavydov added 🧱 enhancement New feature or request ➕ todo labels Mar 6, 2023
@rdavydov
Copy link
Owner

rdavydov commented Mar 7, 2023

More references:
chowder/ttv-cli@b05f421
chowder/ttv-cli@bce9b8a
chowder/ttv-cli@2af1a30

So mining for 15+ channels who frequently create Moments paid off. 😄

Here's the payload from the PubSub API when there's a moment active:

{
  "type": "active",
  "data": {
    "moment_id": "0ad4b5b8-be38-4245-b20d-af357aec18e9",
    "channel_id": "215105998",
    "clip_slug": "SparklySmokyFriesFloof-jwMEwyARRfqhEImG"
  }
}

(Moment link: https://clips.twitch.tv/SparklySmokyFriesFloof-jwMEwyARRfqhEImG)

Everything else about claiming Moments is as we already knew it from the conversations above.

@rdavydov
Copy link
Owner

rdavydov commented Mar 7, 2023

First attempt is done. No error handling, plain and simple, but it should work just fine for now.

https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/tree/moments

Who's willing to test? Please report back any issues related to moments. Don't forget to enable DEBUG log.

@rdavydov rdavydov added the 🙋‍♂️ help wanted Extra attention is needed label Mar 7, 2023
@rdavydov
Copy link
Owner

rdavydov commented Mar 7, 2023

Man, these moments are hard to catch! Haven't been able to find a single channel to test.
Does anyone have a Twitch channel and is willing to participate in moments testing?

@rdavydov rdavydov pinned this issue Mar 7, 2023
@silentguy256
Copy link
Author

Man, these moments are hard to catch! Haven't been able to find a single channel to test. Does anyone have a Twitch channel and is willing to participate in moments testing?

Oh the streamers I regularly watch I found one that had exactly one moment, created 5 months ago. I think you need to be an affiliate to have access to them, so sadly I can't test it with my never really used channel. And I fear most people that stream enough to actually earn money with twitch might not be interested in wasting their 5 a month for some tests :-(

@rdavydov rdavydov removed the ➕ todo label Mar 9, 2023
@Graffics
Copy link

@rdavydov - I follow a streamer which regularly uses all available moments each month.
I've updated to 1.7.7, configured Debug logging for the file based log and changed my run.py to capture the moments.
I should be able to capture a moment given some time. I'll keep an eye out for when this next happens and report back

@Somoon
Copy link

Somoon commented Mar 14, 2023

The feature works fine for me, It claimed two moments with no issue.

10/03/23 21:09:00 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #4 - Received: { "type": "PONG" }
10/03/23 21:09:02 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #1 - Received: {"type":"MESSAGE","data":{"topic":"community-moments-channel-v1.26921830","message":"{\"type\":\"active\",\"data\":{\"moment_id\":\"9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186\",\"channel_id\":\"26921830\",\"clip_slug\":\"GeniusFairKumquatFreakinStinkin-PW5OUByrEZQp0bFJ\"}}"}}

10/03/23 21:09:02 - DEBUG - TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'CommunityMomentCallout_Claim', 'extensions': {'persistedQuery': {'version': 1, 'sha256Hash': 'e2d67415aead910f7f9ceb45a77b750a1e1d9622c936d832328a0689e054db62'}}, 'variables': {'input': {'momentID': '9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186'}}}, Status code: 200, Content: {"data":{"claimCommunityMoment":{"moment":{"id":"9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186","__typename":"CommunityMoment"},"error":null,"__typename":"ClaimCommunityMomentPayload"}},"extensions":{"durationMilliseconds":10,"operationName":"CommunityMomentCallout_Claim","requestID":"01GV6NP98F862E4YHNJH5PSPF4"}}


--

11/03/23 01:31:46 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #1 - Received: {"type":"MESSAGE","data":{"topic":"community-moments-channel-v1.26921830","message":"{\"type\":\"active\",\"data\":{\"moment_id\":\"fcc4c0af-b617-4985-be1f-3a302d2fece6\",\"channel_id\":\"26921830\",\"clip_slug\":\"PrettiestClumsySwanKevinTurtle-lnhuyYXuTWC_KACi\"}}"}}

11/03/23 01:31:47 - DEBUG - TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'CommunityMomentCallout_Claim', 'extensions': {'persistedQuery': {'version': 1, 'sha256Hash': 'e2d67415aead910f7f9ceb45a77b750a1e1d9622c936d832328a0689e054db62'}}, 'variables': {'input': {'momentID': 'fcc4c0af-b617-4985-be1f-3a302d2fece6'}}}, Status code: 200, Content: {"data":{"claimCommunityMoment":{"moment":{"id":"fcc4c0af-b617-4985-be1f-3a302d2fece6","__typename":"CommunityMoment"},"error":null,"__typename":"ClaimCommunityMomentPayload"}},"extensions":{"durationMilliseconds":8,"operationName":"CommunityMomentCallout_Claim","requestID":"01GV74QCERZW5G6KFGEHRX08XW"}}

@rdavydov
Copy link
Owner

The feature works fine for me, It claimed two moments with no issue.

10/03/23 21:09:00 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #4 - Received: { "type": "PONG" }
10/03/23 21:09:02 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #1 - Received: {"type":"MESSAGE","data":{"topic":"community-moments-channel-v1.26921830","message":"{\"type\":\"active\",\"data\":{\"moment_id\":\"9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186\",\"channel_id\":\"26921830\",\"clip_slug\":\"GeniusFairKumquatFreakinStinkin-PW5OUByrEZQp0bFJ\"}}"}}

10/03/23 21:09:02 - DEBUG - TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'CommunityMomentCallout_Claim', 'extensions': {'persistedQuery': {'version': 1, 'sha256Hash': 'e2d67415aead910f7f9ceb45a77b750a1e1d9622c936d832328a0689e054db62'}}, 'variables': {'input': {'momentID': '9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186'}}}, Status code: 200, Content: {"data":{"claimCommunityMoment":{"moment":{"id":"9f3ee4d7-b0c8-4629-8f2c-5db7fc47c186","__typename":"CommunityMoment"},"error":null,"__typename":"ClaimCommunityMomentPayload"}},"extensions":{"durationMilliseconds":10,"operationName":"CommunityMomentCallout_Claim","requestID":"01GV6NP98F862E4YHNJH5PSPF4"}}


--

11/03/23 01:31:46 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #1 - Received: {"type":"MESSAGE","data":{"topic":"community-moments-channel-v1.26921830","message":"{\"type\":\"active\",\"data\":{\"moment_id\":\"fcc4c0af-b617-4985-be1f-3a302d2fece6\",\"channel_id\":\"26921830\",\"clip_slug\":\"PrettiestClumsySwanKevinTurtle-lnhuyYXuTWC_KACi\"}}"}}

11/03/23 01:31:47 - DEBUG - TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'CommunityMomentCallout_Claim', 'extensions': {'persistedQuery': {'version': 1, 'sha256Hash': 'e2d67415aead910f7f9ceb45a77b750a1e1d9622c936d832328a0689e054db62'}}, 'variables': {'input': {'momentID': 'fcc4c0af-b617-4985-be1f-3a302d2fece6'}}}, Status code: 200, Content: {"data":{"claimCommunityMoment":{"moment":{"id":"fcc4c0af-b617-4985-be1f-3a302d2fece6","__typename":"CommunityMoment"},"error":null,"__typename":"ClaimCommunityMomentPayload"}},"extensions":{"durationMilliseconds":8,"operationName":"CommunityMomentCallout_Claim","requestID":"01GV74QCERZW5G6KFGEHRX08XW"}}

That's great! Thanks for the feedback!

@2bc4
Copy link

2bc4 commented Mar 20, 2023

I can also confirm that multiple moments were claimed successfully on my end, seems like there's no issues with it. 👍

@Graffics
Copy link

@rdavydov - Can also confirm a successful claim after patiently wait for one to be created.
Full debug log attached for you if needed for error handling and whatnot.
Included everything from the PubSub Ping / Pong to the moment GQL request - There is a bunch of Drops Campaign info to likely skip over.
MomentCapture.log

@rdavydov
Copy link
Owner

@rdavydov - Can also confirm a successful claim after patiently wait for one to be created. Full debug log attached for you if needed for error handling and whatnot. Included everything from the PubSub Ping / Pong to the moment GQL request - There is a bunch of Drops Campaign info to likely skip over. MomentCapture.log

Nice, thanks for the feedback! I'm glad that it works as expected. :)

@rdavydov rdavydov unpinned this issue Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧱 enhancement New feature or request 🙋‍♂️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants