Advertisement
Shoeken

Untitled

May 14th, 2023 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.56 KB | None | 0 0
  1. $(eval
  2.   const regex = /([0-9]+):([0-9]+):([0-9]+)/g;
  3.   const time = "$(query)".match(regex);
  4.  
  5.   if (time === null) {
  6.     "Please enter a valid time in the format HH:MM:SS";
  7.   } else {
  8.     const seconds = (+time[0].split(':')[0]) * 60 * 60 + (+time[0].split(':')[1]) * 60 + (+time[0].split(':')[2]);
  9.     `$(urlfetch https://api.twitch.tv/helix/clips?broadcaster_id=$(channel)&has_delay=true&duration=${seconds}&started_at=${encodeURIComponent(moment.utc().subtract(seconds, 'seconds').format('YYYY-MM-DDTHH:mm:ss')+'Z')}&access_token=YOUR_ACCESS_TOKEN)`;
  10.   }
  11. )
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement