Skip to content

Instantly share code, notes, and snippets.

@ianliu
Created July 18, 2013 03:07
Show Gist options
  • Save ianliu/6026419 to your computer and use it in GitHub Desktop.
Save ianliu/6026419 to your computer and use it in GitHub Desktop.
YouTube and FlashPlayer nevermore. When a video does not work with HTML5 in YouTube, click "Share > Embed", copy the text and execute "u" script. Voila!
#!/bin/bash
#
# Copyright (C) 2013 Ian Liu Rodrigues <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
url=$(xclip -o -sel clipboard | sed 's|src="//|src="http://|')
tmp=$(mktemp --tmpdir=/tmp XXXXX.html)
echo "<html><body>$url</body></html>" > $tmp
xdg-open $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment