The EU directive is a bit different to the implementations I've seen (which are stronger), but you still have a right to
create such an alternate client (if it's sufficiently different in its expression, which youtube-dl
clearly is):
https://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:... article 6(1):
> 1. The authorisation of the rightholder shall not be required where reproduction of the code and translation of its form within the meaning of points (a) and (b) of Article 4(1) are indispensable to obtain the information necessary to achieve the interoperability of an independently created computer program with other programs, provided that the following conditions are met:
(a) you're allowed to use YouTube, (b) YouTube is undocumented, (c) this only applies to relevant parts of the code.
> 2. The provisions of paragraph 1 shall not permit the information obtained through its application:
to be (a) used for other stuff, (b) distributed, (c) used for cloning or copyright infringement.
> 3. In accordance with the provisions of the Berne Convention for the protection of Literary and Artistic Works, the provisions of this Article may not be interpreted in such a way as to allow its application to be used in a manner which unreasonably prejudices the rightholder's legitimate interests or conflicts with a normal exploitation of the computer program.
Creating youtube-dl isn't infringing on anyone's copyright, and the rightsholder here is Google, so it's allowed. There's wiggle room for arguing – it's not as cut and dry as most Big Bold Legal Statements I make, so iamnotalawyerandthisisnotlegaladvice – but I'm fairly sure this is sound.
In the UK, you have unequivocal rights to do this. https://www.legislation.gov.uk/ukpga/1988/48/section/50B, based on this directive, says:
> (3) In particular, the conditions in subsection (2) are not met if the lawful user—
> (a)has readily available to him the information necessary to achieve the permitted objective;
> (b)does not confine the decompiling to such acts as are necessary to achieve the permitted objective;
> (c)supplies the information obtained by the decompiling to any person to whom it is not necessary to supply it in order to achieve the permitted objective; or
> (d)uses the information to create a program which is substantially similar in its expression to the program decompiled or to do any act restricted by copyright.
The wording in (d), here, is clearer than the EU directive – unless youtube-dl's existence can somehow be shown to be a copyright violation (specifically, if its creation was an act restricted by copyright), it's permitted. Not sure whether this would help in an EU court, but if other countries' implementations have taken the obvious interpretation of the directive, then the other language versions of the directive are probably clear on the matter.