The RIAA would of course argue that examples of infringement in the test cases or readme demonstrate intent. A reasonable response to that might (or might not, depending on the context) be that infringement in those specific cases was never intentional but instead purely by accident.
If the infringement in this case ends up appearing to be intentional, it would probably make for a very uphill battle to argue that the tool itself was only intended for legitimate use cases.
Edit: Of course, it's reasonable to ask - if it's legal for YouTube to distribute the content, does using youtube-dl suddenly make it illegal? Is it a violation of copyright to record a pay per view stream? What about a publicly available stream paid for by ad revenue?
Well that's the question, isn't it? Is downloading those particular URLs infringement if the content is legally allowed to be hosted on YouTube in the first place? If so, was the use of those URLs specifically intended to demonstrate or verify the ability of the tool to infringe copyright? Alternatively, can the tool be said to circumvent a protection device under DMCA section 1201?
(For the record, my answer to all of the above is an emphatic "no".)
Instead of a unit test which successfully downloads a copyright-protected video, it would have a unit test which attempts to download such videos but returns an error message to the user based on a hardcoded blacklist of videos IDs, stored in a separate config file. (It would also have a unit test for successfully downloading a public domain video from the developers' own channel, of course).
The developers could also make clear that they are happy to receive DMCA requests to add specific video IDs to their blacklist. As for what happens if the user deletes the blacklist config file, maybe that won't have a unit test.
If such a fork was successful in fending off court cases, though, it would start to raise interesting First Amendment questions. The difference between the two pieces of software, in practice, is just the text in the README telling people not to break the law (plus a single "Delete" button press after installation, which the user would have to learn about from another source). This would mean that the difference between developers complying with the law and breaking the law is including that text in the README, which effectively seems like compelled speech.
Probably not. If intent were to be demonstrated in court, a derivative work would almost certainly be tainted in turn unless those authors had a _really_ good justification for their actions. (IANAL though; I'm just guessing based on other copyright cases that came up in the media before.)
For example, imagine forking Napster back in the day, redoing the UI, and rewriting half of the internals. Do you really think a court would let that fly? Judges are hardly idiots.
That being said, why not just mirror the original to a host running as a tor hidden service and continue all development efforts there?
(And as someone who has dealt with the music licensing agencies, you always just pay for the license. Paying the big 3 licensing agencies annually for millions of streams cost less than the statutory damages for a single violation.)
Youtube has the right to stream those videos, because they pay the RIAA for a streaming license, which is a thing that music licensing agencies have provided for many years now. In many cases, the videos were uploaded by the recording studio itself, and in those cases presumably Youtube isn't paying a licensing fee because the license is implicit in the upload (but note that many videos uploaded by the artists themselves are not technically theirs to upload because the actual rights were held by the recording company, hence the reason Youtube needs the agreement with the RIAA).
The DMCA take-down exemption you are thinking of is a separate protection, that applies to Youtube taking down videos that aren't licensed by them containing music that isn't licensed by the creator of the music.
The statutory damages would apply in the former case, such as if an artist uploaded their own music video and Youtube didn't have the broad RIAA license. This happens a lot more frequently than you would think.
If that happens, the difference is that these are public domain non-copyrghted materials -- not the copyrighted videos, thus stopping access to the files will be more problematic.