This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Delete City

Description

DeleteCity saves videos from being deleted from YouTube caching a bunch of them on your server, then checking back periodically to see if they have been taken down. When it finds videos that have been removed, it posts them on your blog with a link to the author’s YouTube page. You can tell DeleteCity to use YouTube feeds by keyword to customize which videos you try to save. Devious? Maybe. But also one step in the fight against censorship.

WARNING: The plugin was designed to take advantage of the huge hard drive space/bandwidth allotments of some hosting providers and shouldn’t be used if you are charged for either by the MB.

more info: http://www.jeffcrouse.info/projects/delete-city/

REQUIREMENTS

*nix only! (Mac or Linux server) I use a bunch of system commands (mostly for process control) that I don’t know how to
translate into Windows. I’d love someone to help me, though!

PHP >= 5.1 (according to http://phpduck.com/minimum-php-version-script/)
Python >= 2.5

IMPORTANT: Apparently many videos are blocked outside of the US, so this plugin will probably fail for non-US users.

TO DO

  • Showing deleted videos in modal JS window is too problematic. Think of another way of linking to videos that doesn’t include any javascript.

  • feed should only show 20 entries

  • get_web_page() uses cURL, which might not be installed on all systems. Switch to some full-featured HTTP client.

  • In admin form, cache process indicator doesn’t change when runcache finishes

  • Allow usernames in blacklist

  • regex validation for rate limit

  • Implement dc_max_cache_size option (it currently does nothing)

  • Can I include some file in runcache that will allow me to get WordPress options? That would allow me to avoid all of this parameter passing…

  • What should happen if someone changes their cache directory?

  • Testing if video had been removed: testing for presence of <?xml in response probably isn’t good enough. Here are some removed videos to test with.
    http://www.youtube.com/watch?v=eouvTRd6szQ account terminated
    http://www.youtube.com/watch?v=PgEo_7rMH0Q account terminated
    http://www.youtube.com/watch?v=JdGJxI6LrX4 removed by user
    http://www.youtube.com/watch?v=vQsFI4Wp6kI removed by user

  • Option to automatically email the video author to ask why the video was taken down 🙂

  • Batch query in runcache.php?

  • Catch exceptions from Video class

  • Database security: save database file outside of web-readable directory? Is there a better way?

  • Central database (on deletecity.org) ping when a deleted video is found. (optional for user)

  • Use PDO instead of SQLite
    http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#4.2
    http://henryranch.net/software/ease-into-sqlite-3-with-php-and-pdo/

  • Look for media restriction tag in XML
    eg: http://gdata.youtube.com/feeds/api/videos/LnKJpYGCLsg
    DE

    http://gdata.youtube.com/feeds/api/videos/CD2LRROpph0
    DE

  • Check the PHP version at activation

Screenshots

  • Example post made by DeleteCity of 3 videos that were saved from deletion
  • When a user clicks on one of the thumbnails, the video opens up in a dialog window.
  • The DeleteCity Settings page. Notice you can set the frequency of the cache process, as well as the posting process. You tell DeleteCity which videos to download by supplying YouTube feed URLs. You can also filter out videos by supplying "Blacklist" words. If these words are found int he title or description of the video, it will be skipped.
  • Delete City Status page shows all of the videos that have been saved, as well as all of the videos that are currently in the cache. You can manually delete videos from this page.
  • You can also watch the videos in the status page. It's fun!

Installation

  1. Upload delete-city to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Check out the ‘Delete City Settings’ page under ‘Settings’ in the admin section
  4. Check out the ‘Delete City Status’ page under ‘Plugins’ to see the status of caching/saving, and to manually start the caching process.

FAQ

How does it work?

DeleteCity adds 2 scheduled tasks to your WordPress blog (you can use the CronView plugin to see them https://wordpress.org/extend/plugins/cron-view/): the caching task and the posting task. You can change the frequency of these tasks under “Delete City Settings”.

By default, the caching process runs twice a day. It fetches standard YouTube feeds that you supply and downloads each video in the feed to your server using youtube-dl. It notes the time that it was downloaded, as well as the title, author, and other properties. The next time the caching process is run, DC checks back to see if the video is still available. If it has been removed, the video is marked as “removed”.

To save hard drive space, videos are automatically deleted after 3 days (customizable in Settings) if they are not found to have been removed.

Once a week, DeleteCity will post all of the deleted videos it finds to your blog.

As shown below in the TO DO section, future versions will optionally email the author of the videos and invite them to come back to your blog and comment on why the video was taken down. It will also (optionally) submit deleted videos to a central database that will be made avaialble to the public.

What is youtube-dl?

youtube-dl is a 3rd party script for downloading YouTube videos. You probably
shouldn’t use this directly – it is called from the other scripts. You can
find out more about it here: http://rg3.github.com/youtube-dl/

Why did you make this? or Why would I want this?

Good question! It is unarguably a niche plugin, and not terribly practical.

Let’s just say that this readme file isn’t the proper place for that topic. If you’d like to discuss it, I invite you to email me at jeff [at] crouse [dot] cc.

Contributors & Developers

“Delete City” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.1

  • Initial Release

0.3

  • No longer using SQlite database.
  • Tons of stability improvements
  • Posted videos are moved into uploads directory
  • Posted videos become their own attachments