User:YukinoAi/Tutorial Scratchpad: Difference between revisions

From AniDB
Jump to navigation Jump to search
No edit summary
No edit summary
Line 40: Line 40:
== Part A) Creating an API Key ==
== Part A) Creating an API Key ==


Theory: At some point, meta-information for files should be submited using Avdump2. That meta-information is initially associated with the user account that made the submission. While users normally enter usernames/passwords for authentication, Avdump2 needs a unique string of characters to update meta-data. In this context, the string of characters that authenticates a user utilizing Avdump2 is known as an <code>API Key</code> or a <code>UDP API Key.</code>
===Theory===
 
At some point, meta-information for files should be submited using Avdump2. That meta-information is initially associated with the user account that made the submission. While users normally enter usernames/passwords for authentication, Avdump2 needs a unique string of characters to update meta-data. In this context, the string of characters that authenticates a user utilizing Avdump2 is known as an <code>API Key</code> or a <code>UDP API Key.</code>


UDP API keys can be specified in the user profile section on AniDB.net.
UDP API keys can be specified in the user profile section on AniDB.net.
===Procedure===


[[/anidb.net/perl-bin/animedb.pl?show=login|Log in to AniDB]]<br />
[[/anidb.net/perl-bin/animedb.pl?show=login|Log in to AniDB]]<br />
Line 106: Line 110:
== Part B) Dealing With Groups ==
== Part B) Dealing With Groups ==


===Theory===
Every file entry should be associated with a release group. The group name or tag is usually in the file name, usually in brackets <code>[ ]</code>. It is important to identify the release group and to verify the group already exists in AniDB.
Every file entry should be associated with a release group. The group name or tag is usually in the file name, usually in brackets <code>[ ]</code>. It is important to identify the release group and to verify the group already exists in AniDB.


Examples:
Examples:


{|
{| class="wikitable"
!width="5%"| Filename
!width="5%"| Filename
!width="5%"| Group Name or [Tag]
!width="5%"| Group Name or [Tag]
Line 149: Line 154:


Verify the group exists by searching for it on AniDB.
Verify the group exists by searching for it on AniDB.
===Procedure===


Open [[/anidb.net|Anime DataBase (AniDB)]].
Open [[/anidb.net|Anime DataBase (AniDB)]].
Line 172: Line 179:
== Part C) On Using Avdump2 ==
== Part C) On Using Avdump2 ==


'''Theory''':
===Theory===


* A file entry in AniDB has 2 main components, the entry itself and the associated metadata.
* A file entry in AniDB has 2 main components, the entry itself and the associated metadata.
Line 189: Line 196:


This tutorial will cover creating files associated with a release on AniDB using their ed2k identifier also submitting dumps.
This tutorial will cover creating files associated with a release on AniDB using their ed2k identifier also submitting dumps.
===Installation===


[[/wiki.anidb.net/w/Avdump_GUI|Download the portable GUI version]], [http://static.anidb.net/client/avdump-gui-2.3.2-portable.7z direct], (it has both the CLI and GUI) and [http://www.7-zip.org/download.html extract it] to C:\Users\User\Downloads. See this random [http://www.gofree.com/Tutorials/ExtractingZipFiles.php 7-Zip Tutorial]. Alternative [http://static.anidb.net/client/avdump-gui.msi MSI installer].
[[/wiki.anidb.net/w/Avdump_GUI|Download the portable GUI version]], [http://static.anidb.net/client/avdump-gui-2.3.2-portable.7z direct], (it has both the CLI and GUI) and [http://www.7-zip.org/download.html extract it] to C:\Users\User\Downloads. See this random [http://www.gofree.com/Tutorials/ExtractingZipFiles.php 7-Zip Tutorial]. Alternative [http://static.anidb.net/client/avdump-gui.msi MSI installer].
Line 203: Line 212:
To calculate and export the identifier information, including the ed2k hash, use either the Avdump2 CLI or GUI.
To calculate and export the identifier information, including the ed2k hash, use either the Avdump2 CLI or GUI.


'''Avdump2 CLI''':
===Avdump2 CLI===


WikiPage: https://wiki.anidb.net/w/Avdump2
WikiPage: https://wiki.anidb.net/w/Avdump2
Line 350: Line 359:
Select source and quality of the file:
Select source and quality of the file:


{|
{| class="wikitable"
! Source
! Source
! Quality
! Quality
Line 544: Line 553:


[[File:https://i.imgur.com/3N0Sg5f.png|AniDBUpdate_cmd.png]]
[[File:https://i.imgur.com/3N0Sg5f.png|AniDBUpdate_cmd.png]]


-----
-----
Line 552: Line 560:
[[File:https://i.imgur.com/eLFgKWf.png|AniDBUpdate_drag1.png]]<br />
[[File:https://i.imgur.com/eLFgKWf.png|AniDBUpdate_drag1.png]]<br />
[[File:https://i.imgur.com/sxIleWJ.png|AniDBUpdate_drag2.png]]
[[File:https://i.imgur.com/sxIleWJ.png|AniDBUpdate_drag2.png]]


-----
-----
Line 587: Line 594:
* When sending a folder, all files within that folder and all subfolders will be processed.
* When sending a folder, all files within that folder and all subfolders will be processed.


'''Avdump2 GUI''':
===Avdump2 GUI===


avdump2gui.exe is the graphical user interface (GUI) wrapper for <code>avdump2cl.exe</code> and supports a subset of the features:
avdump2gui.exe is the graphical user interface (GUI) wrapper for <code>avdump2cl.exe</code> and supports a subset of the features:
Line 642: Line 649:
To learn more about creqs please check out:
To learn more about creqs please check out:


https://wiki.anidb.net/w/Main_Page
"Adding Data" subsection on https://wiki.anidb.net/w/Main_Page


AniDB Staff on IRC :
For further help with a problem or just for chatting visit IRC:


IRC: https://wiki.anidb.net/w/IRC:anidb<br />
IRC Wiki page: https://wiki.anidb.net/w/IRC:anidb<br />
irc://irc.synirc.net/anidb
Channel Address: irc://irc.synirc.net/anidb

Revision as of 00:35, 16 August 2017

Anime DataBase (AniDB) is a website that provides information about Anime.

It keeps track of show information and fansub releases for them. It has some social aspects as well. More info. Databases are only useful if they are updated frequently, so this tutorial is about keeping fansub releases on AniDB up to date.

For a more concise guide, please consider this alternative:Tutorial:How to Add Files for Dummies!.

Introduction

AniDB needs to know 3 things to create a full entry for a release:

  1. Which group (or user) released the file.
  2. The unique hash of the file and file name.
  3. The file metadata (resolution, audio tracks, subtitles, etc).

The Avdump2 utility can be used to automatically update AniDB file entries and will be used later.

Important Notes:

  • The release group (Horrible Subs, Kametsu, Doki) should be associated with each file when creating an entry for it. Non-offical, or files that are not distributed, should not be added to AniDB.
  • Before creating an entry for a file, the unique ed2k hash must first be calculated because the ed2k hash will be used in identifying the file.
  • The ed2k hash for the unique identfier can be generated by using Avdump2, or any other program that can generate ed2k hashes.
  • The file's metadata should be updated using the Avdump2 tool.

And so, it is convenient to use the Avdump2 tool to both generate the unique identifier and also update file metadata.

Additional Resources:
https://wiki.anidb.net/w/Main_Page
https://wiki.anidb.net/w/Auto-creqing
https://wiki.anidb.net/w/Avdump2

Prerequisites:

  1. Obtain a file to add to AniDB.
  • The group name is usually present in the file name or description.
  1. Create an AniDB account.
  2. Login and verify that account.

Part A) Creating an API Key

Theory

At some point, meta-information for files should be submited using Avdump2. That meta-information is initially associated with the user account that made the submission. While users normally enter usernames/passwords for authentication, Avdump2 needs a unique string of characters to update meta-data. In this context, the string of characters that authenticates a user utilizing Avdump2 is known as an API Key or a UDP API Key.

UDP API keys can be specified in the user profile section on AniDB.net.

Procedure

Log in to AniDB
On the left navigation pane, at the bottom is a section labeled Account. Click on Settings.

https://i.imgur.com/fEqwtnZ.png

Under profile, in the main navigation window, there are tabs. Click on the one that says Account.

anidb_accountSettings_AccountTab_highlight.png

There should be a section called UDP API Key with two fields, one with a label and another empty one.

anidb_account_udpApiKey_empty.png

Any alphanumeric (a-z, A-Z, 0-9) character sequence no longer than 32 characters will work for the API key. For the purposes of this tutorial GRC's Perfect Passwords will be used.

Open a new tab in the web browser and go to GRC's Perfect Passwords page.

In the last box of characters labeled a-z, A-Z, 0-9, highlight 20-30 characters as shown below.

grc_pp_20charas_highlight.png

Then copy the selected characters to the clipboard.

  • Right-Click - Copy
  • Ctrl + c

grc_pp_20characters_copy.png

Change tabs back to AniDB's page.

In the empty field under the UDP API Key, right-click and select Paste. Alternatively: Ctrl + v.
anidb_account_udpAPIKey_paste.png

anidb_account_udpAPIKey_inserted.png

Click on the Apply button at the bottom. It should be right above Back.
anidb_account_udpAPIKey_apply.png
The UDP API Key field should turn into asterisks (*) to show that it has saved it properly.
anidb_account_udpAPIKey_asterisks.png
The API key should also be saved for use with Avdump2 later on, so lets save it to notepad.

Windows key or Click on the start menu and type in notepad.

windowskey_notepad.png

notepad_apiKey_paste.png

Save the file as something descriptive or as anidb_apiKey.txt in your user profile folder (C:\Users\User) or desktop (C:\Users\User\Desktop).

  • File - Save As...
  • Ctrl + s

FYI: Changes to the API key are updated immediately server-side but old entries are cached for an unspecified amount of time, usually less than 30 minutes. Attempting to use an old key will produce this error in the Avdump2cl.exe:

avdump2cl_apiKey_timeout.png

The Avdump2 GUI will simply not respond when authentication fails. More on this later.

Part B) Dealing With Groups

Theory

Every file entry should be associated with a release group. The group name or tag is usually in the file name, usually in brackets [ ]. It is important to identify the release group and to verify the group already exists in AniDB.

Examples:

Filename Group Name or [Tag]
[Yuki] Log Horizon - 01 (BD 1080p HEVC Dual-Audio AAC) [2D099D6D].mkv Yuki
Log Horizon - 01 (1080p) BD x265 10-bit (DualAudio) AC3 AAC [KoTuWa].mkv KoTuWa
[ReinForce] Log Horizon - 01 (BDRip 1920x1080 x264 FLAC).mkv ReinForce
[JacobSwaggedUp] Log Horizon - 01 (BD 1280x720).mp4 JacobSwaggedUp
Log.Horizon.S01E01.720p-Hi10p.BluRay.AAC2.0-CTR.[B73B6592].mkv CTR
{AnimeServ.NET} Log Horizon 01 (Blu-ray)(1920x1080 x264 AAC).mp4 AnimeServ.Net
[RHxUHA-WING]Log_Horizon_S1[01][BIG5][720P].mp4 RHxUHA-WING
[BDMV][150724] Log Horizon - Vol.1 n/a
(Shin-Raw) Log Horizon 01 720p (HEVC-HEAAC) [7F99A1E7].mp4 Shin-Raw

For Anime, most groups put their names in brackets [ ] but not always. Group names like DVDISO, RawDVD, BDMV, Anime BD, RAW, R2RAW are keywords that indicate a group is not associated with the upload, usually for uploading unmodified content.

When there is a - or & in the group name, that sometimes means it is a joint release between 2 or more groups. Joint releases are also known as "virtual" releases in AniDB terminology.

In an example above, RHxUHA-WING may be a single group's name or it may be 2 different groups, RHxUHA and WING. Read the description in the download page to find out or search AniDB.

Verify the group exists by searching for it on AniDB.

Procedure

Open Anime DataBase (AniDB).

At the top right next to Search change the search type from all to group.

anidb_search_group1.png

Enter the group name found in the filename and click on Search.

anidb_search_group2.png

In the example above, Doki was used as an example of a group (highlighted for emphasis).

Click on the group name in the Name column. In the below example it would be Doki Fansubs.

anidb_search_group3.png

Only if the group does not exist, create it. Before actually adding a group, read this and this.

For the purposes of this tutorial, it will be assumed the group name already exists.

Part C) On Using Avdump2

Theory

  • A file entry in AniDB has 2 main components, the entry itself and the associated metadata.
  • AniDB stores metadata information for files that are not yet in the database. This means it is possible to add a file entry and then add the metadata, or alternatively, add the metadata to AniDB and create the file entry later.
  • The metadata and the file entry are normally linked using a unique identifier created from the ed2k and the filesize.

Thus, to create a file entry in AniDB, the ed2k hash must be known and the group name should be known.

The main purpose of the Avdump2 utility, and its GUI wrapper, is to automate updating AniDB file entries. It does 3 things:

  1. Hash files to identify them (ed2k).
  2. Extract Audio/Video/Subtitle and other media information.
  3. Send that information to the server.

Together, the hash information and the media information are called a "dump," short for metadata dump or file dump.

This tutorial will cover creating files associated with a release on AniDB using their ed2k identifier also submitting dumps.

Installation

Download the portable GUI version, direct, (it has both the CLI and GUI) and extract it to C:\Users\User\Downloads. See this random 7-Zip Tutorial. Alternative MSI installer.

For the purposes of this tutorial, it will be assumed the CLI tool is at:
C:\Users\User\Downloads\avdump-gui-2.3.2-portable\appdata\avdump-gui-2.3.2.win32\AVDump2CL.exe
And the GUI tool is available at:
C:\Users\User\Downloads\avdump-gui-2.3.2-portable\avdump2gui.exe

  • AVDump2CL.exe is a non-interactive program with a command line interface (CLI) that can export the ed2k and related information to later create file entries on AniDB. If used with the --Authentication flag (short form: --Auth) and a Username/UDP API key pair, it can also submit metadata dumps for processing.
  • avdump2gui.exe is a graphical user interface (GUI) wrapper around the CLI with a subset of the CLI's functionality.
  • avdump2gui.exe must be used with an API key at all times.

To calculate and export the identifier information, including the ed2k hash, use either the Avdump2 CLI or GUI.

Avdump2 CLI

WikiPage: https://wiki.anidb.net/w/Avdump2

Start a command prompt:

  • Windows + r - Type cmd.exe and press Enter.
  • Or
  • Windows key - Type cmd.exe and press Enter.

windowskey_cmd.png

cmd_empty.png

Let's change the current path to C:\Users\User\Downloads\avdump-gui-2.3.2-portable\appdata\avdump-gui-2.3.2.win32 using cd or pushd.

pushd C:\Users\User\Downloads\avdump-gui-2.3.2-portable\appdata\avdump-gui-2.3.2.win32

Or

Open an explorer window to: C:\Users\User\Downloads\avdump-gui-2.3.2-portable\appdata\avdump-gui-2.3.2.win32 and drag and drop the folder icon on the top left of the address bar to the command prompt window.

cmd_drag_folder.png

This will populate the command prompt window with the path to the folder automatically, as shown below. This technique can also be used for individual files.

cmd_drag_folder2.png

With the command prompt window selected, press the Home key or hold the Left Arrow on the keyboard to change the cursor to the position furthest to the left.

cmd_drag_folder3.png

Enter cd and a single space.

cmd_drag_folder4.png

Press Enter.

cmd_drag_folder5.png

The cd stands for current directory and using it has changed the current directory of the command prompt window to the extracted path of AVDump2CL.exe.

It is possible to verify AVDump2CL.exe is in the current directory by listing the directory contents or checking to see if the file itself is present. List the direct contents using dir, or, for Linux, ls.

cmd_drag_folder6.png

Or check for the executable directly by typing the first few characters av and using Tab to cycle through the available options.

avdump2cl_help.png

Running AVDump2CL.exe without any options will list many available options.

Running AVDump2CL.exe --help will list all of the available options.

avdump2cl_help2.png

The syntax of AVDump2CL.exe is:

AVDump2CL.exe [--options] [file/folder] [file/folder]

This means that AVDump2CL.exe takes some options and also one or more file or folder paths. The options will specify the type of processing and what file or folder to process.

For the purproses of this tutorial, there is a file named:
[Yuki] Log Horizon - 01 (BD 720p HEVC Dual-Audio AAC) [F8708ABE].mkv
And this file has been placed in:
C:\Users\User\Downloads\Log Horizon

To check what happens when a file or folder is specified but with no processing options, enter `avdump2cl.exe', and then a space and then drag a file to the command prompt window.

avdump2cl_dragTest1.png

The file name with the full path will be automatically populated in the command prompt window.

avdump2cl_dragTest2.png

Press Enter.

avdump2cl_dragTest3.png

So Avdump2cl.exe complains that no processing options has been specified, so there is nothing to do. So let's give it something to do.

We are trying to use this program to extract ed2k hash information to create a new release on AniDB. That is done using the --ExportEd2kLinks option, or --Exp for short.

The syntax is: Avdump2cl.exe --Exp=[ed2kFileName] [file/folder]

When running the actual command, the file/folder section should be substituted for the actual file or folder name as in the previous command. ed2kFileName should be substituted for a text file name, like ed2k.txt. An example of these substitutions is shown below.

Let's run the command and see what happens.

Avdump2cl.exe seems to have processed the file and created a text file called ed2k.txt in its current directory. The file contains one line of contents:

ed2k://|file|[Yuki] Log Horizon - 01 (BD 720p HEVC Dual-Audio AAC) [F8708ABE].mkv|484345397|C33743B735BF1B282B185E1B2E611270|/

This is what the ed2k links used by AniDB look like. After the protocol specifier (ed2k://), is the file keyword, the filename, the file size, and then finally the ed2k hash.

The file size 484345397 is in raw bytes. 484345397 divided by 1024 is 472,993.55 which is the size shown in explorer:

avdump2cl_exportTest3.png

C33743B735BF1B282B185E1B2E611270 happens to be the ed2k hash of this specific file. Every file will have a different ed2k hash.

Let's inform AniDB that this file exists using the ed2k link.

Wiki: https://wiki.anidb.net/w/Mass_add:Files

Open a web browser and login to anidb.net.

Go to the entry of the Anime in AniDB you want to add a release for. This can be done by using the search feature.

At the top right, enter the name of the Anime. For the purposes of this tutorial the series name is Log Horizon. Change the content type to anime and then click on Search.

anidb_addFile1.png

Log Horizon has multiple seasons, so each of them are displayed. Click on the correct season.

anidb_addFile2.png

Scroll down to the Group Status section. Click on the + Add New Release button.

anidb_addFile3.png

This should bring up the mass add files page.

anidb_AddFile4.png

Set the group, source, release date, quality, track, and language options.

Wiki: https://wiki.anidb.net/w/How_to_get_started_with_creqing

Let's start with the group. Enter the group name and click on Search.

anidb_AddFile5.png

The group name should change and have a drop down menu. Be sure to select the correct group name, identified above in Part B. For the purposes of this tutorial, the correct group name is Yuki Subs [YukinoAi].

anidb_AddFile6.png

Change the template from manual to the most appropriate setting. [Yuki] Log Horizon - 01 (BD 720p HEVC Dual-Audio AAC) [F8708ABE].mkv is labeled as Dual-Audio so the dual template should be used. For most fansub releases with only a single japanese audio track and subtitles, the fansub template should be used instead.

anidb_AddFile7.png

Select source and quality of the file:

Source Quality
DVD/BD very high
DTV high
VHS low

If you happen to know any more information about the file, like if the CRC32 of the file matches the official source, enter it. When in doubt, leave that field unmodified. Audio and subtitle track information can usually be left alone alone because that information will be updated later when the meta-data dump uploaded to AniDB becomes associated with the file entry.

At the very bottom, paste the edk2 link from and click on Next.

anidb_AddFile8.png

Make sure the episode number is correct. If you happen to know the date the file was first distributed, enter it in dd.mm.yyyy format. When the information looks correct, click on Add Files.

anidb_AddFile9.png

Success!

anidb_AddFile10.png

To verify the stub-entry exists, go back to the Anime page. In the Group Status Section, click on the expand button for the group.

anidb_AddFile11.png

This will populate the Episodes section with file entries for that group. In the image below, episode 1 of Log Horizon has 2 file entries for the selected group. The top entry has already had the meta-information filled in by avdump2. The bottom entry is the stub that was just created.

anidb_AddFile12.png

  • Notice that the audio track, resolution and subtitle information was filled in by avdump2 automatically for the top file where as this information is not yet correct for the bottom file.
  • Under the Hash column, there is an icon AU overlayed and a checkmark. This means a the file was verified by avdump2.
  • The bottom file has CRC overlayed with a checkmark. That means the entry has been marked to indicate that the CRC for the file, matches the official one provided by the release group.
  • So the top file has not been marked as having a verified CRC and the bottom one has not had its metadata updated by avdump2. Let's fix the metadata.

Back in command prompt world...

So, we are trying to use Avdump2cl.exe to send a metadata dump to the server. This can be done using the --Authentication flag, or --Auth for short. The auth flag instructs Avdump2cl.exe to attempt to authenticate with AniDB servers. If authentication fails, Avdump2cl.exe will print an error message and stop. If successful, Avdump2cl.exe will process the file and attempt to send the dump to AniDB servers.

Note: Please note that all data sent to the server will be logged using IP and user id. If you would like to check what data will be submitted to the server after authentication, run the following command:
Avdump2cl.exe -ca [file/folder]

The auth flag has the following syntax:

Avdump2cl.exe --Auth:[username]:[api_key] [file/folder]

username in the above command should be subtituted with your AniDB username. The api_key is the character string that was specified in the AniDB profile in Part A. Notice the colon : in between the username and api_key. If following this tutorial, it should be available at C:\Users\User\anidb_apiKey.txt or C:\Users\User\Desktop\anidb_apiKey.txt. Copy it and right-click paste it into the command prompt:

avdump2cl_auth1.png

avdump2cl_auth2.png

Enter a space and then drag and drop the file to add to AniDB into the command prompt window as before:

avdump2cl_auth3.png

The command below should be sufficent to submit the meta-data.

avdump2cl_auth4.png

Press Enter. If it works, the following should appear after processing completes:

avdump2cl_submitVerify.png

The line that says:
ACReq( Done: 0 Todo: 1 Failed: 0 Pending: 0 )
Means that processing has finished and avdump2cl.exe will attempt to upload the dump.

The line that says:
ACReq( Done: 1 Todo: 0 Failed: 0 Pending: 0)
Means the server has accepted the data from avdump2cl.exe and will store it for later processing. Success!

If you get an error like the following:
avdump2cl_authFail1.png

  • Double check the API key is correct.
  • The API key being used should be exactly the same one that was entered in the user profile page.
  • UDP API keys should also be alphanumeric and no longer than 32-characters. Keys longer than 32 characters may get trunkated to 32.
  • Since UDP API keys are cached, changing API keys will take some time to clear, usually less than 30 minutes. Attempting to authenticate before that will result in the above error, even if using the correct key and syntax. So wait 30 minutes and try again basically.

If you get an error like the following:

avdump2cl_authFail2.png

  • Notice the error is from ACReq.Authentication. This indicates something to do with authentication caused the error.
  • In the above command, that is due to a syntax error in the --Auth switch. The correct syntax is --Auth=username:api_key but in the above command the username is missing.
  • Press the up arrow key to bring up the previous command in the command prompt window. Then fix the syntax and run the command again. It should then work.

Assuming dump submission succeeds, the AniDB page for the file will likely show the following:

[not-changed.png]

In other words, while the correct meta-data has been submitted as part of a dump to AniDB, the information for that file has not changed.

This is normal. There is a delay for certain submissions to AniDB. The next section contains more information about how change requests work but for now just know there is a delay and the information will be automatically updated later.

For the file above, this is what the information looked like less than 24-hours later:

avdump2cl_submitVerifyComplete.png

So far, we have added a single file entry and submitted the associated dump for processing. However, Log Horizon S1 has more than 1 episode. Updating each episode this way, by running avdump2cl.exe twice, once to create the edk2 link and a second time to submit the dump data, would take an excessively long time. avdump2cl supports combing different flags together into one command:

avdump2cl.exe --Auth=[username]:[api_key] --Exp=[filename] [file/folder]

If the above command syntax is used on a file, avdump2cl.exe will authenticate with AniDB servers, then if successful, will process the file, submitting the meta-data to AniDB and then export the ed2k link to a file. This means we can run half the number of commands and still get the output needed to update AniDB!

There is another thing to notice about that syntax. At the end, it says file/folder meaning that avdump2cl.exe also supports specifying a folder instead of individual files. If a folder is specified, like say: C:\Users\User\Downloads\Log Horizon then avdump2cl.exe will process every file inside of that folder, generating edk2 links for each file.

With the above information, the actual command to run would be:
avdump2cl.exe --Auth=YukinoAi:uFEV55lknCwglqdRp1jte36NQ --Exp=avdump2cl-ed2k-Links.txt "C:\Users\User\Downloads\Log Horizon"

Notice that C:\Users\User\Downloads\Log Horizon needs quotation marks " " surrounding it because Log Horizon has a space. As long as there are no spaces, quotation marks do not have to be used. Without quotation marks, avdump2cl.exe will treat and process all of the files in C:\Users\User\Downloads\Log and also all of the files inside the Horizon folder. Since neither of these folders exist, the commad will fail:

avdump2cl_syntaxFail1.png

If using the drag and drop technique instead of copy-paste, quotation marks will automatically be added as appropriate.

So, running the above command with proper quotation marks will work. The edk2 links generated in the text file can be added to AniDB using the Mass Add page as shown above. However, having to worry about syntax is cumbersome, as is starting a command prompt. Is there not a better way?

An alternative approach is to create a shell script that will invoke avdump2cl.exe with the correct syntax automatically. If anything bad happens, like authentication or syntax errors, it will be easy to solve because the correct syntax can just be copied from the text file back to a normal command prompt.

Open notepad and copy-paste the following cryptic text into a file called AniDBUpdate.bat or just download it [here].

@echo off
set username=putUsernameHere
set api_key=putApiKeyHere
set pathToAvdump2=C:\Users\User\Downloads\avdump-gui-2.3.2-portable\appdata\avdump-gui-2.3.2.win32

set mode=auth
::mode can be either exp or auth

if /i "%~1" equ "" (goto usage)
if /i "%~1" equ "?" (goto usage)
if /i "%~1" equ "/?" (goto usage)
if not exist "%~1" (echo.
echo   "%~1" does not exist
goto usage)

if not exist "%pathToAvdump2%\avdump2cl.exe" (echo.
echo   "%pathToAvdump2%\avdump2cl.exe" does not exist
goto usage)
if /i "%username%" equ "putUsernameHere" goto usage
if /i "%api_key%" equ "putApiKeyHere" goto usage

if /i "%mode%" equ "exp" "%pathToAvdump2%\avdump2cl.exe" --Exp="%~dp1\ed2k-%~n1.%random%.txt" "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9"
::if /i "%mode%" equ "exp" "%pathToAvdump2%\avdump2cl.exe" --Exp="%userprofile%\Desktop\ed2k-Link-%~n1.%random%.txt" "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9"
if /i "%mode%" equ "auth" "%pathToAvdump2%\avdump2cl.exe" --Auth="%username%:%api_key%" --Exp="%~dp1\ed2k-%~n1.%random%.txt" "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9"
::if /i "%mode%" equ "auth" "%pathToAvdump2%\avdump2cl.exe" --Auth="%username%:%api_key%" --Exp="%userprofile%\Desktop\ed2k-Link-%~n1.%random%.txt" "%~1" "%~2" "%~3" "%~4" "%~5" "%~6" "%~7" "%~8" "%~9"

goto end
:usage
echo.
echo   OMG^! Hi^!^!^!  Usage Help:
echo.
echo   %~nx0 can be used to automate usage of avdump2cl.exe
echo   Please update "username" and "api_key" before using %~nx0.
echo.   
echo   CLI Usage: 
echo       %~nx0 "C:\Users\User\Downloads\Log Horizon"
echo       %~nx0 "C:\Users\User\Downloads\Log Horizon\episode01.mkv"
echo.
echo   Drag and drop also works.
echo.
echo   For "right-click Send to" functionality, copy a shortcut to:
echo   "%appdata%\..\roaming\Microsoft\Windows\SendTo"
echo.
pause

:end

AniDBUpdate_1.png

The three highlighted items need to be changed before using the script. Update the username and API key appropriately. Make sure there are no trailing whitespaces in either the username or api_key. "Name" will work but "Name " will not. Example:

AniDBUpdate_2.png

For the pathToAvdump2 entry, the path should not include a trailing \.

Example:

  • C:\avdump-gui-2.3.2-portable will work.
  • C:\avdump-gui-2.3.2-portable\ will not work.

After entering the username and the UDP API key, here are 3 ways to run the above text file:

1) Hardest: Command prompt method: Navigate to the correct directory and type AniDBUpdate.bat.

AniDBUpdate_cmd.png


2) Drag and drop method: Drag and drop a file or folder onto the batch file.

AniDBUpdate_drag1.png
AniDBUpdate_drag2.png


3) Easiest: Send-to method: Use the right-click Send to context menu.

AniDBUpdate_drag1.png

For the send-to method to work, the file, or a shortcut to it, must be placed at:
C:\Users\Username\AppData\Roaming\Microsoft\Windows\SendTo
To open this folder automatically, paste the following into an explorer address bar or Windows key + r
"%appdata%\..\roaming\Microsoft\Windows\SendTo"

  1. Ctrl + c to copy: "%appdata%\..\roaming\Microsoft\Windows\SendTo"
  2. Windows key + r
  3. Ctrl + v to Paste the above contents
  1. Press Enter
  2. Right-Click - create a new shortcut
  1. Move the shortcut from where it was created to \SentTo.
  1. Rename the shortcut appropriately.

With the command prompt and send-to methods:

  • Up to 9 discrete files and folders may be selected
  • When sending a folder, all files within that folder and all subfolders will be processed.

Avdump2 GUI

avdump2gui.exe is the graphical user interface (GUI) wrapper for avdump2cl.exe and supports a subset of the features:

Avdump2 GUI Limitations. The GUI:

  • always requires authenticating.
  • will not generate links without specifying a valid username and valid API key pair, every time.
  • Note: This information is forcibly saved across instances.
  • must be deliberately started every time to be used.
  • will not issue an error message when authentication fails and simply not respond.
  • If the GUI does not respond, it is advisable to test for authentication errors using AVDump2CL.exe.
  • requires updating prior to usage.

With these limitations in mind. Launch avdump2gui to have it update automatically.

  1. Specify the username and api-key.
  2. Use the Files and Folder buttons too add files to process.
  1. When complete, click start to see what happens.
  • If/When nothing happens check for authentication errors using AVDump2CL.exe using the instructions provided above.
  1. If it works, nothing will happen for a while, and then eventually ed2k links will appear in the ed2k export window. The dump data should have been submitted to AniDB in the background, although there is no way to check.

The ed2k links in the export window can now be submitted to AniDB. Detailed instructions for this are provided above.

Part D) Understanding AniDB Change Requests (creq)

AniDB is a user-driven database. A normal way to contribute is to issue change requests (creqs for short), which means that a moderator has to approve suggested changes before they are published. Request links can usually be found on every page that has editable content for logged in users.

  • Except for obvious changes, always describe the reason for changes in the request and/or the source of the information.
  • Be prepared to follow up the requests made. Creqs will be denied if there is no response to moderator questions.

More info:
https://wiki.anidb.net/w/How_to_update_or_correct_existing_entries
https://wiki.anidb.net/w/How_to_get_started_with_creqing

Avdump2, used above, is AniDB's mechanism to submit automatic change requests (acreqs or auto-creq). These automatic change requests do not always require moderator approval because the information (file-metadata) has been verified programmatically. For auto-creqing:

  • All data sent to the server will be logged with IP and user id.
  • There is no direct connection between data sent to AniDB and creqs generated. The data dumps will just be stored for later processing into creqs.
  • There is no way to check the current status for a dump.
  • Avdump2cl.exe will display a count of the files that have been submitted to the server as output as ACReq ( Done: # [...], but that is all.
  • Usually, it should take at least 24 hours from the moment a file metadata dump has been submited untill the file data actually changes. If any irregularities occur, or when there is too much data pending, it will take more time. The system auto-creqs to add missing tracks within 72 hours.
  • It is possible to dump files currently not in the database. The data is still stored and will be used later if/after the file has been registered.

In other words, when Avdump2 submits meta-data dumps to AniDB, the data itself may get processed into a change request. But first, in order to automatically apply the dumped metadata information to a file, that file must be registered first. The process of submitting edk2 links is that registration process. The metadata dumps themselves also contain the edk2 hash information that serves as the basis to link it to registered files.

To learn more about creqs please check out:

"Adding Data" subsection on https://wiki.anidb.net/w/Main_Page

For further help with a problem or just for chatting visit IRC:

IRC Wiki page: https://wiki.anidb.net/w/IRC:anidb
Channel Address: irc://irc.synirc.net/anidb