Check deleted files on filehost, reupload and replace links on website?

229
June 29, 2017, at 05:19 AM

i need some help on the following topic. I recently created a website streaming media files hosted at Openload.co.

API: https://openload.co/api

On the website media files are available through the embedded video player code provided by Openload which are stored inside a MySQL database table

db.media.embed (Of type text)

<iframe src="https://openload.co/embed/hpPbM8l8rV0/video.mp4" scrolling="no" frameborder="0" width="700" height="430" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>

Now the following question:

How to check the files uploaded to my Openload.co account with the embedded code links inside my db´s table and if missing replace the file with the same file reuploaded from a external/local FTP backup source or similar.

I don´t have any existing approach on how to do this so far in code. So i would like to ask here how to deal with it best?

Answer 1

If using Python, use the is_file() method of the io module to test if the file exists. Then if it doesn't, have your code fetch the file, maybe using wget if your webserver is running on linux. See:

How do I check whether a file exists using Python?

Rent Charter Buses Company
READ ALSO
Creating array of fields then looping through set in PHP

Creating array of fields then looping through set in PHP

I'd like to simplify how my app builds a query and loops through the resultsMost of the actual code works, except that PHP does not display all of the results fetched from my query

285
MySQL LOAD XML LOCAL slows down after first 100k entries

MySQL LOAD XML LOCAL slows down after first 100k entries

I am trying to import a large XML (arround 700MB) into a MySQL databaseIt is working so far but the thing is, it is terribly slow

330
Why do I not get a response from JSON post request unless the number of rows is limited?

Why do I not get a response from JSON post request unless the number of rows is limited?

I am using a JSON post request to return rows from a mySQL databaseMy server-side language is php and unless I limit the results in sql to about 45 I don't get a response

237
How to convert mySQL time to python time?

How to convert mySQL time to python time?

I'm trying to retrieve time variable from mySQL database using pythonBelow shows the python code I use to retrieve the time variable from mySQL database

379