Handmade Hero » Forums » Code » Downloading videos using Resilio Sync (formerly BitTorrent Sync)
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3032 Downloading videos using Resilio Sync (formerly BitTorrent Sync)
2 years, 6 months ago Edited by Mārtiņš Možeiko on Nov. 6, 2016, 4:31 a.m.

Casey has provided me access to 1080p videos he uploads to YouTube. These videos are from OBS recording and should have a bit better quality than ones on YouTube, because it transcodes videos to be a bit smaller. Files from Casey are ~1.5x larger than videos on YouTube.

I will share them using Resilio Sync (previously known as BitTorrent Sync.

For those who doesn't know Resilio Sync, in few words it is like a Dropbox, but without server. Basically it downloads files using P2P - same technology as torrents. There is no central server where files are stores, everybody who downloads files also uploads same files to other peers. Discovering shared files happens through sharing special key for folder (similar to what "magnet" URL is for torrents).

Read-only key to download files is BOZWLNQW3PPZXLV53HVXI3MVHA5EV5FTF. My upload bandwidth is 250Mbit, so as long as you have good connection and more people joins in sharing files download speeds should be good.

Here's is short guide how to get files using Resilio Sync on Windows:
  1. Go to https://www.getsync.com and get Free version. No need to have Pro, although for first 30 days Free version will have all Pro functionality).
  2. In main interface choose "Options" item (gear on to right corner) and choose "Manual connection..."
  3. Paste key above
  4. Now choose "Sync all" to be On or Off. When it is ON all files will be downloaded. Each episode is something like ~900MB. Currently total size for all 349 episodes/chats is 317GB). If you choose this to keep OFF, you'll need to right click in Windows Explorer individual files you want to download and select "Sync to this device" option. You can change this setting later. Read more information about this feature here.
  5. Press Next, and choose new folder where to place files.
  6. Download and watch videos
For more information read Help Center for Resilio Sync: http://help.getsync.com

Sync All = OFF is Pro-only feature. After 30-day trial will end, this feature won't be available anymore. If you want to download only individual files after that you'll need to use ignore list - help.getsync.com/customer/portal/articles/1910522
Create or edit .sync/IgnoreList text file that contains files that you don't want to download. For example, like this:
1
2
3
4
5
introduction_to_c_*
emacs_*
handmade_hero_day_0*
handmade_hero_day_100*
handmade_hero_day_11*

This will ignore all introduction to c, emacs and days 000-119 videos. It will download 120+ days.
Here is full list of file names (up to day 349): https://gist.github.com/mmozeiko/...6e9a88cec10#file-handmadehero-txt

If you want to watch prestream video,
chizran has provided me with his archived prestream videos (from Twitch). They are available with following read-only key: BXX52F55Z5ZQNRQWRMTMESHCZWHPOQEOD. They are available from day 72. Each episode is something like from 100 to 600 MB (and sometimes even less, or even more). Total size currently is 110G (as of day 349), and full list of file names is here: https://gist.github.com/mmozeiko/...0#file-handmadehero_prestream-txt

For HandmadeCon videos+audio you can use following read-only key: BC2KP7MYJJKPF4GK5M6ZEGHU77TYUEHXP. Currently 15GB with follwing files: https://gist.github.com/mmozeiko/...f6e9a88cec10#file-handmadecon-txt
cmuratori
Casey Muratori
802 posts
1 project

Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.

#3040 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

Yes, I have a definitive collection of 1080p ones that have not gone through YouTube, and I could upload those to you in some convenient way if that helps... want to e-mail me at [email protected] and we can sort it out?

- Casey
miotatsu
岩倉 澪
109 posts
1 project

riscy.tv host

#3041 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

Awesome! Set up BTSync and will happily seed (not that I have great upload though)

This is the first time I've ever heard of BTSync, but because it uses the bittorrent protocol I wonder if it is possible to seed and/or leech with a regular bt client like rtorrent?
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3042 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

Cool, if we can get original 1080p videos that would be great. I sent you an email.

miotatsu - afaik BTSync uses different protocol than torrents. It actually is not yet published, but they have said they will do that at some point.
miotatsu
岩倉 澪
109 posts
1 project

riscy.tv host

#3043 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

Ahh, interesting. btw, do you or anyone else here know what exactly it expects for password hashing in the json config for accessing the webui (linux)?
storing a password in plain-text seems silly but the comment for password_hash is vague: // ,"password_hash" : "" // password hash in crypt(3) format

doesn't say anything about what the salt should be...
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3044 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago Edited by Mārtiņš Možeiko on March 16, 2015, 10:11 p.m.

It can be any salt. Salt is encoded in output of hash for crypt function. See here.

Not sure if it is possible to call this functionality in command-line, but using C you can write simple code that calls this function. Or simply use Python, if you have one installed:
1
2
$ python2 -c "import crypt; print crypt.crypt('password', '\$6\$salt\$')"
$6$salt$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy.g.

Or Perl:
1
2
$ perl -e "print crypt('password', '\$6\$salt\$'), \"\\n\""
$6$salt$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy.g.

$6$ means it will use sha512 (see "here" link at the beginning).
miotatsu
岩倉 澪
109 posts
1 project

riscy.tv host

#3045 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

ahh I see, admittedly I had only skimmed through the man page and didn't realize the salt was encoded in the output hash, thanks :)
boleban
Boleban
8 posts
#3049 Downloading Youtube videos using BitTorrent Sync
2 years, 6 months ago

Awesome.I used to download 1080P videos with the website clipconverter.cc. The download speed is very slow. BitTorrent Sync will save me a lot of time.Thank you very much. mmozeiko.
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3082 Downloading videos using BitTorrent Sync
2 years, 6 months ago

Casey has provided me access to 1080p videos he uploads to YouTube. These videos are from OBS recording and should have a bit better quality than ones on YouTube, because it transcodes videos to be a bit smaller. Files from Casey are ~1.5x larger than videos on YouTube.

Read-only key for these new videos is BOZWLNQW3PPZXLV53HVXI3MVHA5EV5FTF. I updated first post with new info.

I'll keep previous video files from YouTube for a while so if somebody started downloading them can finish it, but not sure for how long I'll do that.
Drexir
9 posts
#3083 Downloading videos using BitTorrent Sync
2 years, 6 months ago

I can't seem to select only files I want to download. It wants to download them all starting with emacs tutorial video. It seems to have finished downloading it but I can't play it either. I click sync all to off. It deleted my emacs 500mb or so .bts file. And when I right click in the explorer to sync. It never does anything.
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3084 Downloading videos using BitTorrent Sync
2 years, 6 months ago

What media player you are using? If you have playback problems, try using Media Player Classic - Home Cinema or VLC media player.

If you have problems downloading, try to remove folder fully from BTSync and disk. Then add it from scratch with "Sync All" set to "Off". Then right-click the file you want do download, select "Sync to this device" and then wait until it fully downloads. You can monitor progress in GUI by making it show "Progress" or "Receiving" column. Depending on your internet connection (similar to torrents) it can take few minutes for download to start - who knows how BTSync is searching for peers from the key.
Drexir
9 posts
#3085 Downloading videos using BitTorrent Sync
2 years, 6 months ago

I have both home cinema and vlc installed. Playing videos is not an issue. I already disconnected. Reconnected. Sync all on / off. Deleted folder. Reconnected. In the context menu "Sync to this Device". It does nothing. I guess the only thing it can do is download all of it. With a 6mbit connection that will take forever to download over 120GB. For only a few of the videos I need.
Drexir
9 posts
#3086 Downloading videos using BitTorrent Sync
2 years, 6 months ago

I managed to stop the syncing all before it started downloading. And have the one file syncing. A normal torrent would be better though for this big of downloading. It's a lot easier to pick what to upload / download.
mmozeiko
Mārtiņš Možeiko
1476 posts
1 project
#3087 Downloading videos using BitTorrent Sync
2 years, 6 months ago

Torrent doesn't work well for our use case, because you will need to update it every weekday. And that would require everybody to redownload new .torrent file every day and recheck all files every day to resume downloading. Unless you want to create new .torrent file for each video... which is mess again.
Drexir
9 posts
#3088 Downloading videos using BitTorrent Sync
2 years, 6 months ago

Ah didn't realize you had to do all that. Well I got it working. Seeding at about 49.2KB p/s terrible upload. 20th century DSL technology. But I seem to have it working. The context menu syncing seems to be a bit glitchy though.

Thanks for the uploads! For some reason if you download the youtube version it's only 730kb p/s these are 2000 kb p/s I don't know why the youtube ones are so low. I've seen youtube 1080p videos with a bitrate of 5000kb p/s. 800 kb p/s doesn't even qualify for DVD quality. Heck I don't think I've seen a DVD bitrate below 5000 kb p/s or 5Mbit p/s. And blu-ray standard is 40Mbit p/s. It's a bit pointless to have 1080p video and the data loss be so big that no matter how many pixels are on screen it's just gonna be a pixelated mess. And youtube randomly knocked off 2 bits of audio.

5Mbit p/s video and 320Kbit p/s audio is all I ask from youtube. Pretty sure I'm the lowest common denominator and my mere 6Mbit p/s connection could handle that. 720p would be 2500Kbit 480p would be 1250Kbit. 480p would still look better than 1080p and I'm pretty sure any one can handle 1.25Mbit p/s down I hope so anyways.