every other country in the world has passed a law just like this in the years since. Here in the EU, it came in through Article 6 of the 2001 EU Copyright Directive.
art 6 of Copyright and Information Society Directive 2001/29
Note 2001/29 has been amended by Directive on Copyright in the Digital Single Market 2019/790, but I don't think in this aspect.