youtube-dl-cheetsheet
youtube-dlを使ってタスクを便利にこなすためのスニペット集
Pythonistaで使えるやつ
import youtube_dl, os, appex
# playbook.yml | |
--- | |
- hosts: all | |
sudo: true | |
user: vagrant | |
tasks: | |
- name: Vimをインストールする | |
yum: name=vim state=present | |
- name: zshをインストールする | |
yum: name=zsh state=present |
{ | |
"title": "my confs", | |
"description": "karabiner is god", | |
"rules": [ | |
{ | |
"description": "ctrl-m to enter", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { |
require 'httparty' | |
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'downloaded')) | |
response = HTTParty.get 'https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=hatsune_miku&json=1' | |
response | |
.parsed_response | |
.map { |r| { r['file_url'] } } | |
.tap { |r| puts r } | |
# .each { |u| |
youtube-dlを使ってタスクを便利にこなすためのスニペット集
import youtube_dl, os, appex
指定したディレクトリにあるwavファイルを320kbpsのmp3ファイルに変換する
変換されたwavファイルは自動で削除します
brew install ffmpeg
で入るbrew install youtube-dl |
https://twitter.com/keisei_1092/status/861206475472904193
main.rb
require 'sinatra'
# 新着ツイートを監視してニコニコのURLを含んでいたらなにかするやつ | |
# | |
# Usage | |
# gem install tweetstream | |
# CONSUMER_KEY= CONSUMER_SECRET= OAUTH_TOKEN= OAUTH_SECRET= ruby vocalonobis_watcher.rb | |
require 'tweetstream' | |
class String | |
def includesNicoUrl? |
<!DOCTYPE html> | |
<html style="height: 100%;"> | |
<head> | |
<title>skyline</title> | |
</head> | |
<body style="background-color: #F2F2F2; height: 100%; padding-left: 10%; padding-right: 10%;"> | |
<textarea style=" | |
margin: 0; | |
border: none; | |
width: 100%; |