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

View a broadcast won't work #34

Closed
SENPAY98K opened this issue Dec 10, 2021 · 7 comments
Closed

View a broadcast won't work #34

SENPAY98K opened this issue Dec 10, 2021 · 7 comments

Comments

@SENPAY98K
Copy link

I am trying to do the task of view a broadcase in the community badge, and i was not able to manage it, idk why tho

module.exports = function(steamClient, RequestCommunity, RequestStore, SessionID, options, callback){
var ViewBroadcast = {
    headers: {
		Host: 'steamcommunity.com',
		Referer: 'https://steamcommunity.com/?subsection=broadcasts'
	},
    json: true
};
var BroadcasterID64 = "76561198985577189";
var postURL02 = 'https://steamcommunity.com/broadcast/watch/'+BroadcasterID64+'/';

RequestCommunity.Post(postURL02, ViewBroadcast, function (err, res, data) {
    if (err) {
        console.log('View Broadcast: FAIL');
    }
    if (!err) {
        console.log('View Broadcast: DONE');
    }
});
});

no error, but did not work!! any suggestion ?

@quer
Copy link
Owner

quer commented Dec 10, 2021

yes, but there are no easy way. i did look into this. and there is no simple "post". i did try a lot of thinks. but i ended up. giving up.

I think it registered, if you are connected to the socket, that the stream is running on.

@SENPAY98K
Copy link
Author

I even tried with Get method and did not work.
Anyway thanks for trying 😃

@HenkerX64
Copy link
Contributor

HenkerX64 commented Feb 1, 2022

Probably to late, but I wrote a script that can solve the most community badge quests, the broadcast view task I solved with following steps:

  1. find trend broadcasts: https://steamcommunity.com/apps/allcontenthome/?l=english&appHubSubSection=13
  2. pick a link href and cut the watchId (probably you can skip this step if you configure your watchId)
  3. then call https://steamcommunity.com/broadcast/getbroadcastmpd/?steamid=#WatchId#&sessionid=#&broadcastid=0&viewertoken=0&watchlocation=5
    with
headers: {
            'Origin': 'https://steamcommunity.com',
            'Referer': 'https://steamcommunity.com/broadcast/watch/' + watchId
        },

All request are done with GET, watchId is a steamId from streamer. Then the task should be marked as solved. You can just do the step 3 if you predefine the watchid yourself.

If anyone have interest on community badge solution, let me know and I will publish my solution as merge request.

@HenkerX64
Copy link
Contributor

HenkerX64 commented Feb 1, 2022

I changed your solution, try it out, but don't forget to change the broadcast stream id to actual one:

module.exports = function (steamClient, RequestCommunity, RequestStore, SessionID, options, callback) {
    var BroadcasterID64 = "xxxxx";
    var ViewBroadcast = {
        headers: {
            'Origin': 'https://steamcommunity.com',
            'Referer': 'https://steamcommunity.com/broadcast/watch/' + BroadcasterID64
        },
        qs: {
            'steamid': BroadcasterID64,
            'sessionid': SessionID,
            'broadcastid': 0,
            'viewertoken': 0,
            'watchlocation': 5,
        },
        json: true
    };
    var url = 'https://steamcommunity.com/broadcast/getbroadcastmpd/';

    RequestCommunity.get(url, ViewBroadcast, function (err, res, data) {
        if (!err && data && data.success === 'ready') {
            console.log('View Broadcast: DONE');
        } else {
            console.log('View Broadcast: FAIL');
        }
        callback();
    });
};

@SENPAY98K
Copy link
Author

SENPAY98K commented Feb 1, 2022

I changed your solution, try it out, but don't forget to change the broadcast stream id to actual one:

@HenkerX64 works flawless, thanks.

@quer
Copy link
Owner

quer commented Feb 1, 2022

i would like to see the community badge solution.

@HenkerX64
Copy link
Contributor

ok, then I will prepare the code and create a MR tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants