online code to read file and use it into html video mediasource code example

Example 1: how to read a json resposnse from a link in python

import urllib, json

url = "put url here"
response = urllib.request.urlopen(url)
data = json.loads(response.read())
print (data)

Example 2: how to write and read a text file in jdiscord.js

npm install fs --save -g
//You can read from the file like this:
// File system stuff.
var fs = require("fs");

// Get the text file and load it into a variable.
var file = fs.readFileSync("path/to/my/text/file.txt", "utf8");

//And you can write to the file like this:
// Write the file
fs.writeFile("path/to/my/text/file.txt", myVariable, function (err) {

    // Checks if there is an error
    if (err) return console.log(err);
  });