j0k3r / graby-site-config

Graby site config files
Other
18 stars 29 forks source link

Paywall configuration for lemonde.fr #18

Closed bdunogier closed 5 years ago

bdunogier commented 7 years ago

Pushing to this upstream as I don't believe that this custom configuration belongs with the original repo.

Adds paywall config for lemonde.fr. But it doesn't "really" work, because of how their paywall is implemented. If you request lemonde.fr, you will always get the truncated version. If you request abonnes.lemonde.fr, you will always get the full version. Even if you don't have an account.

Unless graby supports some kind of string substitution for the URL, then the only solution is to use the abonnes.lemonfr.fr url.

techexo commented 7 years ago

It seems that Graby's configuration allows to rewrite urls on the fly. Wouldn'it be possible to use that for "abonnés" to redirect any lemonde.fr to abonnes.lemonde.fr?

Edit: I confirm that the redirection via the User Agent works perfectly (as expected), via the modification of HttpClient.php

'rewrite_url' => array(
                'docs.google.com' => array('/Doc?' => '/View?'),
                'tnr.com' => array('tnr.com/article/' => 'tnr.com/print/article/'),
                '.m.wikipedia.org' => array('.m.wikipedia.org' => '.wikipedia.org'),
                'm.vanityfair.com' => array('m.vanityfair.com' => 'www.vanityfair.com'),
                'www.lemonde.fr' => array('www.lemonde.fr' => 'abonnes.lemonde.fr'),
            ),

However, it would work with everyone, no matter the presence of credentials or not.

tcitworld commented 7 years ago

I think Le Monde's laywers would have something to say about that.

techexo commented 7 years ago

I think Le Monde's laywers would have something to say about that.

I don't know if it could be possible to configure that in the graby-site-config instead that in the sources of graby directly, and that redirection to be done only if the login form checked the credentials. It is obvious that the proposed workaround here is an exploiting of a bug and that modifications should be made to not authorize anyone to download abonnes articles!

j0k3r commented 7 years ago

It is not yet possible to put condition for other option regarding url rewrite. But like for the monde diplomatique, maybe we can build a custom subscriber to change that: https://github.com/wallabag/guzzle-site-authenticator/blob/master/lib/Guzzle/FixupMondeDiplomatiqueUriSubscriber.php

techexo commented 6 years ago

Edit: related to issue https://github.com/wallabag/wallabag/issues/2909#issuecomment-410640134