updated readme and fixed some things
This commit is contained in:
@@ -15,13 +15,13 @@ export default async function(obj) {
|
||||
let req_act = await fetch(`${apiURL}/guest/activate.json`, {
|
||||
method: "POST",
|
||||
headers: _headers
|
||||
}).then(async (r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
}).then((r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
|
||||
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
||||
_headers["x-guest-token"] = req_act["guest_token"];
|
||||
let showURL = `${apiURL}/statuses/show/${obj.id}.json?tweet_mode=extended&include_user_entities=0&trim_user=1&include_entities=0&cards_platform=Web-12&include_cards=1`
|
||||
if (!obj.spaceId) {
|
||||
let req_status = await fetch(showURL, { headers: _headers }).then(async (r) => { return r.status == 200 ? r.json() : false;}).catch((e) => { return false});
|
||||
let req_status = await fetch(showURL, { headers: _headers }).then((r) => { return r.status == 200 ? r.json() : false;}).catch((e) => { return false});
|
||||
if (!req_status) {
|
||||
_headers.authorization = "Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw";
|
||||
delete _headers["x-guest-token"]
|
||||
@@ -29,11 +29,11 @@ export default async function(obj) {
|
||||
req_act = await fetch(`${apiURL}/guest/activate.json`, {
|
||||
method: "POST",
|
||||
headers: _headers
|
||||
}).then(async (r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
}).then((r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
||||
|
||||
_headers["x-guest-token"] = req_act["guest_token"];
|
||||
req_status = await fetch(showURL, { headers: _headers }).then(async (r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
req_status = await fetch(showURL, { headers: _headers }).then((r) => { return r.status == 200 ? r.json() : false;}).catch(() => {return false});
|
||||
}
|
||||
if (!req_status) return { error: 'ErrorCouldntFetch' }
|
||||
if (req_status["extended_entities"] && req_status["extended_entities"]["media"]) {
|
||||
@@ -63,13 +63,13 @@ export default async function(obj) {
|
||||
variables: {"id": obj.spaceId,"isMetatagsQuery":true,"withSuperFollowsUserFields":true,"withDownvotePerspective":false,"withReactionsMetadata":false,"withReactionsPerspective":false,"withSuperFollowsTweetFields":true,"withReplays":true}, features: {"spaces_2022_h2_clipping":true,"spaces_2022_h2_spaces_communities":true,"verified_phone_label_enabled":false,"tweetypie_unmention_optimization_enabled":true,"responsive_web_uc_gql_enabled":true,"vibe_api_enabled":true,"responsive_web_edit_tweet_api_enabled":true,"graphql_is_translatable_rweb_tweet_is_translatable_enabled":true,"standardized_nudges_misinfo":true,"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled":false,"responsive_web_graphql_timeline_navigation_enabled":false,"interactive_text_enabled":true,"responsive_web_text_conversations_enabled":false,"responsive_web_enhance_cards_enabled":true}
|
||||
}
|
||||
|
||||
let AudioSpaceById = await fetch(`https://twitter.com/i/api/graphql/wJ5g4zf7v8qPHSQbaozYuw/AudioSpaceById?variables=${new URLSearchParams(JSON.stringify(query.variables)).toString().slice(0, -1)}&features=${new URLSearchParams(JSON.stringify(query.features)).toString().slice(0, -1)}`, { headers: _headers }).then(async (r) => {
|
||||
let AudioSpaceById = await fetch(`https://twitter.com/i/api/graphql/wJ5g4zf7v8qPHSQbaozYuw/AudioSpaceById?variables=${new URLSearchParams(JSON.stringify(query.variables)).toString().slice(0, -1)}&features=${new URLSearchParams(JSON.stringify(query.features)).toString().slice(0, -1)}`, { headers: _headers }).then((r) => {
|
||||
return r.status == 200 ? r.json() : false;
|
||||
}).catch((e) => {return false});
|
||||
|
||||
if (AudioSpaceById) {
|
||||
if (AudioSpaceById.data.audioSpace.metadata.is_space_available_for_replay === true) {
|
||||
let streamStatus = await fetch(`https://twitter.com/i/api/1.1/live_video_stream/status/${AudioSpaceById.data.audioSpace.metadata.media_key}`, { headers: _headers }).then(async (r) => {return r.status == 200 ? r.json() : false;}).catch(() => {return false;});
|
||||
let streamStatus = await fetch(`https://twitter.com/i/api/1.1/live_video_stream/status/${AudioSpaceById.data.audioSpace.metadata.media_key}`, { headers: _headers }).then((r) => {return r.status == 200 ? r.json() : false;}).catch(() => {return false;});
|
||||
if (!streamStatus) return { error: 'ErrorCouldntFetch' };
|
||||
|
||||
let participants = AudioSpaceById.data.audioSpace.participants.speakers
|
||||
|
||||
Reference in New Issue
Block a user