From b9a6b7f9568fd65736365bfed46c12388c099902 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Tue, 28 May 2024 16:13:52 +0200 Subject: [PATCH] mp: ass param to force mpsessid lm: handle curl commands --- lemonde.php | 27 +++++++++++++++++---------- mediapart.php | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/lemonde.php b/lemonde.php index 53bbdf4..fcbb75f 100644 --- a/lemonde.php +++ b/lemonde.php @@ -2,20 +2,27 @@ extracted url from curl command:

' . $url . '

'; + } + $epub = new TPEpubCreator(); $epub->temp_folder = 'temp/'; $epub->epub_file = $_POST['epub']; $epub->title = $_POST['title']; - + if ($_POST['cover']) { $coverurl = $_POST['cover']; @@ -23,7 +30,7 @@ file_put_contents('temp/cover.jpg', $coverdata); $epub->AddImage( 'temp/cover.jpg', 'image/jpeg', true ); } - + // cache json in case url expires $tempjsonpath = 'temp/' . hash('md5', $url) . '.json'; $json = ''; @@ -40,7 +47,7 @@ $publication = json_decode($json); $content = array_filter($publication->Content, function($item) { return $item->Category == 'Le Monde'; }); usort($content, function ($a, $b) { return $a->PageNumber - $b->PageNumber; }); - + foreach ($content as $article) { $articlebody = array_filter($article->ContentItem, function($item) { return $item->ContentType == 'text/xml'; })[0]; @@ -57,19 +64,19 @@ // echo($articlebody->HtmlText); } } - + if ( ! $epub->error ) { $epub->CreateEPUB(); - + if ( ! $epub->error ) { echo 'Success: Download your book here.'; } - + } else { echo $epub->error; } } - + ?>
diff --git a/mediapart.php b/mediapart.php index f470964..964f8b0 100644 --- a/mediapart.php +++ b/mediapart.php @@ -1,6 +1,16 @@ + + + '; +} + /*ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL);*/ @@ -95,4 +105,11 @@ if ( ! $epub->error ) } else { echo $epub->error; } -?> \ No newline at end of file +?> + + + Force MPSESSID: + +
+ + \ No newline at end of file