https://wiki.bakabt.me/api.php?action=feedcontributions&user=NailCola&feedformat=atomBakaBT Wiki - User contributions [en]2024-03-29T06:18:32ZUser contributionsMediaWiki 1.39.6https://wiki.bakabt.me/index.php?title=Talk:Patching&diff=5682Talk:Patching2012-10-04T05:42:00Z<p>NailCola: Created page with 'Could someone fix the formatting under "Making a Batch Script for Mac"? I couldn't figure out how to include the code box under the list. As a result I had to add the third item …'</p>
<hr />
<div>Could someone fix the formatting under "Making a Batch Script for Mac"? I couldn't figure out how to include the code box under the list. As a result I had to add the third item manually (not using the list formatting) and it doesn't line up with everything else.</div>NailColahttps://wiki.bakabt.me/index.php?title=Patching&diff=5681Patching2012-10-04T05:37:31Z<p>NailCola: </p>
<hr />
<div>__TOC__<br />
<br />
=xdelta=<br />
<br />
The main method the anime community uses to patch files is by using xdelta. This is necessary when a group release a new version of an episode (Usually in a batch). xdelta is a commmand line program using [http://en.wikipedia.org/wiki/VCDIFF VCDIFF]. When patching using xdelta you will be provided with .xdelta files. With the xdelta command prompt and .xdelta files you can patch whichever file needed.<br />
==Patching with xdelta (Windows and UNIX/Linux)==<br />
[[File:xdelta.png|thumb|right|Patching a file using the cmd]]<br />
{| border="1"<br />
|- <br />
! scope="row" | xdelta3 -d -s<br />
| old_file<br />
| delta_file <br />
| new_file <br />
|}<br />
#For Windows users, download xdelta3 from [http://code.google.com/p/xdelta/downloads/list here]. For UNIX users this step is optional. ''If the latest version isn't working for you try an older release''<br />
#Copy the file into the folder with your .xdelta file and the file you want to patch. ''For your convenience, windows users rename to xdelta3.exe''<br />
#Open up your cmd/terminal and navigate to the folder where the '''episode''', '''.xdelta''', and '''.exe''' file is at.<br />
#Type in <pre>xdelta3 -d -s old_filename.mkv deltafile.xdelta new_filename.mkv</pre><br />
#You will have to wait a few moments for the patch to finish. Once done you will see the new file in your folder. <br />
<br />
If you get your .xdelta file from a fansub group you may not need to use -s. This will work just fine:<br />
<pre>xdelta3 -d file.xdelta</pre><br />
<br />
==Patching with xdelta (Mac)==<br />
You'll have to install xdelta on your Mac. Easy way is to install [http://mxcl.github.com/homebrew/ Homebrew] and type "brew install xdelta" in your terminal. After that put the patch files in same same folder as your v1 files, navigate with cd on your terminal in that folder, and use the standard xdelta3 commands:<br />
<pre><br />
xdelta3 -d file.xdelta<br />
</pre><br />
<br />
You may need Xcode for Homebrew. It's either on the Mac OS install disc or you can download it from the Apple developer site with an Apple ID.<br />
<br />
If you're having problems with homebrew, an alternative is to use [http://projects.sappharad.com/tools/multipatch.html MultiPatch].<br />
<br />
<br />
==Batch Files on Windows==<br />
It's easy to patch more than one file at the same time. You'll need to create a .bat file.<br />
#Open notepad<br />
#For every line type in exactly what you would type inside the cmd, except with a different .xdelta file for each episode.<br />
#At the end type in '''@pause''' (''Optional'', just prevents the command line from closing).<br />
#Save as a .bat and run the file.<br />
<br />
This is an example of how a .bat would look like for xdelta patching (Special thanks to Tiberium Wolf):<br />
<br />
<pre><br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_01_[720p][900E8404].mkv" "01v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_01_[720p-v2][DFC39F0F].mkv"<br />
<br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_02_[720p][3996A1DF].mkv" "02v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_02_[720p-v2][77D7488F].mkv"<br />
<br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_06_[720p][CD450656].mkv" "06v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_06_[720p-v2][5C608A55].mkv"<br />
<br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_08_[720p][23E4B85A].mkv" "08v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_08_[720p-v2][8990A041].mkv"<br />
<br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_11_[720p][50D118C3].mkv" "11v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_11_[720p-v2][56E32A06].mkv"<br />
<br />
xdelta3 -d -s "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_12_[720p][3AA25CFB].mkv" "12v2.xdelta" "[UTW-Underwater]_Tasogare_Otome_x_Amnesia_-_12_[720p-v2][2A76D55B].mkv"<br />
<br />
@pause<br />
</pre><br />
<br />
<br />
<br />
==Making a Batch Script for Mac==<br />
If you have a lot of items to patch and don't want to do it one at a time, you can make a simple script that will automatically patch one file after another.<br />
#Open a text editor of your choice. [http://www.barebones.com/products/TextWrangler/download.html TextWrangler] is a good free option, but Apple's own TextEdit works fine as well. If you use TextEdit, in the menubar click ''Format'' > ''Make Plain Text'' before typing anything.<br />
#Use the following as an example of what to type: <br />
<pre><br />
#!/bin/bash<br />
<br />
xdelta3 -d /path_to_patch_number_1.xdelta &&<br />
xdelta3 -d /path_to_patch_number_2.xdelta &&<br />
xdelta3 -d /path_to_patch_number_3.xdelta &&<br />
xdelta3 -d /path_to_patch_number_4.xdelta &&<br />
xdelta3 -d /path_to_patch_number_5.xdelta<br />
</pre><br />
<br />
:The first line shows the location of the Unix shell that you're going to run the commands in. In this instance the shell called '''bash''' is located in the folder named '''bin''' on the main hard drive. If you are using OS X 10.3 or later '''#!/bin/bash''' is the first command you want to type at the top. <br />
<br />
:Here is a breakdown of the next lines:<br />
<br />
:*'''xdelta3''' runs the xdelta patching utility<br />
<br />
:*'''-d''' is a flag/option that tells the '''xdelta3''' command to decompress<br />
<br />
:*'''/path_to_patch_number_1.xdelta''' is the path to the .xdelta file (the patch)<br>For example '''/Users/Spike/Anime/CowboyBebop/CowboyBebopPatch01.xdelta''' says that the patch named '''CowboyBebopPatch01.xdelta''' is in the '''CowboyBebop''' folder which is in the '''Anime''' folder, which in turn is in the home folder of user '''Spike''' on the main hard drive. If any of your folder's names have a space in them you need to put quotes around them. For example, if the folder '''CowboyBebop''' was actually named '''Cowboy Bebop''', then the path would look like this '''/Users/Spike/Anime/"Cowboy Bebop"/CowboyBebopPatch01.xdelta'''.<br />
<br />
:*'''&&''' tells the shell to wait until previous command is done before running the next one<br>So '''xdelta3 -d /path_to_patch_number_2.xdelta''' won't run until '''xdelta3 -d /path_to_patch_number_1.xdelta''' is done. '''xdelta3''' can only patch one file at a time so if you forget the '''&&''' you will get the error message '''xdelta3: too many filenames'''.<br />
:3. Finally, save the document with the extension .sh. When you want to run it just drag the file into the terminal window and hit enter. Remember to have the .xdelta files in the same folder as the video files you want to patch.</div>NailCola