The share link isn't working!

The share link which governs which video to play is not working! I have verified tons of times and am sure that the error is not on my side. Waiting for response!

It seems to work fine for me. Can you provide an example link which is not working for you?

I’m using user data to input the value in. That doesn’t seem to work. So I hard coded it to see wheather the problem was on my end and itstill didn’t work. Here is the example link. The Kid LAROI, Justin Bieber - STAY (Official Video) - YouTube

That video plays fine for me. Which browser and operating system are you using?

Chrome & Windows. This also doesn’t play for my colleague. It’s not as if there’s something blank there. There is always something there but not what we put the share variable. It’s always an animated movie of sorts. A few tries earlier it was LLama Drama(what even is that XD), and sometimes it was an animated movie named something from ‘C’ I don’t know. Do you know what error I’m facing?. When I try to view the content of share I get a Key Error that it doesn’t exist. That’s also something even tho it’s declared bright and clear. I have tried several ways to bypass it like writing user input onto a file and then reading from it and storing the value in share, still it’s the same thing. I still get the Key Error. Any help?

Ahhh okay… you are using the API? Now i get it. I assume you read this? Watch2Gether API Documentation

Yes, yes I did. Please provide me with a solution if you can!

Do you have some sample code. It’s really hard to say whats going on without seeing your code.

Well, here it is XD. Can you spot the error if any?


@client.command(name = 'create')
async def create(ctx, arg):
  url = 'https://w2g.tv/rooms/create.json'
  wkey = os.getenv('WKEY')
  bg = '#00ff00'
  opacity = 50

 

  headers = {

    'Accept': 'application/json',
    'Content-Type': 'application/json'
  }

  data= {
    'w2g_api_key' : wkey, 
    'bg_color' : bg,
    'share' : arg ,
    'bg_opacity' : opacity
  }





  data = requests.post( url , headers , data).json()

  print(data)

  streamkey = data['streamkey']

  keyem = discord.Embed(
    title = 'Here is your stream link!',
    color = 16776960,
    url = 'https://w2g.tv/rooms/' + streamkey
  )


  #keyem.add_field(
    #name = 'Or if you just want the strem key!',
    #value = streamkey
 # )

  await ctx.send(embed = keyem)

I guess you have to remove the quotes around the variable names in your “data” object. Or is this just pseudocode?

That’s just pseudo-code , still I edited it to yourr needs :slight_smile:

Okay, what is the return code you get from the API?

Nothing atm. As I said, the API is working fine, just that it isn’t displaying the video we asked for. That’s why the API isn’t returning any error messages or error codes. Sorry for the late response!

I see. Is the background color being set correctly? Please be aware, that the video you set is only loaded when the room is opened for the first time.

Weird, the bg color isn’t being displayed either. It’s just white each time.

Could you explain the point below in detail?

Please be aware, that the video you set is only loaded when the room is opened for the first time.

So, what’s the status quo?

Since the background color is not set either, it seems like your JSON body is not properly formatted and therefore ignored. As you can see in the Javascript examples (Watch2Gether API Documentation) the settings object is converted to JSON by calling JSON.stringify. You need to adapt that in your code as well. Does that help?