feat: allow import of newer pocket data export files in csv format#1023
feat: allow import of newer pocket data export files in csv format#1023fmartingr merged 5 commits intogo-shiori:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1023 +/- ##
==========================================
- Coverage 34.71% 34.28% -0.44%
==========================================
Files 61 61
Lines 5326 5393 +67
==========================================
Hits 1849 1849
- Misses 3253 3320 +67
Partials 224 224 ☔ View full report in Codecov by Sentry. |
|
Hey @melnary, thanks for the contribution! I'm not super famiiar with pocket and their exports so for me if you tested it it's good to go. Can you take a look at the CI errors and correct them though? |
|
@fmartingr Hi! I was wondering where the CI was at :3 |
|
Dont worry about coverage, the linter errors are here: https://github.com/go-shiori/shiori/actions/runs/12276136781/job/34257042686#step:3:1 |
Signed-off-by: Mel <einebeere@gmail.com>
|
@fmartingr Please approve the workflows again, my local linter is reporting no errors, should be good to go! |
|
Ah and one more thing! I did manage to track down an older HTML export file, to make sure that I didn't end up breaking the HTML import feature, luckily it all still works smoothly! |
That's awesome! |
fmartingr
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
|
Hi, thank you all for the patch. However, this patch use a mandatory "cursor" field (Invalid CSV format. Header must be: title,url,time_added,cursor,tags,status) that is not in my pocket extract. Could you make this field optional please ? |
|
Hey @Panphico - just wanted to let you know how you can have a workaround for your problem (solved is just seconds ago on my own). You can just import your pocket .csv file into a spreadsheet app and add an empty column "cursor" at the right position. After that you export that file as .csv file and this can be imported by shiori. I managed to get my roughly 3000 bookmarks imported this way. If you are on a mac and try this with numbers - you might run into trouble as numbers uses ";" as seperator and shiori doesn't like that. Long story short: Use something else (I used google sheets). Hope this helps. Have a nice one. |
|
Hi,
Thank you for your help, that's how I solved it. I should have shared my workaround 🙂
It's a bit teddious but it works. I had some issues too but I just modified it with a text editor.
26 mai 2025 11:21:34 Sven Hohlfeld ***@***.***>:
…
[Image]*wunderkind2k1* left a comment (go-shiori/shiori#1023)[#1023 (comment)]
Hey @Panphico[https://github.com/Panphico] - just wanted to let you know how you can have a workaround for your problem (solved is just seconds ago on my own). You can just import your pocket .csv file into a spreadsheet app and add an empty column "cursor" at the right position. After that you export that file as .csv file and this can be imported by shiori. I managed to get my roughly 3000 bookmarks imported this way. If you are on a mac and try this with numbers - you might run into trouble as numbers uses ";" as seperator and shiori doesn't like that. Long story short: Use something else (I used google sheets). Hope this helps. Have a nice one.
—
Reply to this email directly, view it on GitHub[#1023 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAUGXWZRMVJNXLK26FBP65D3ALMJZAVCNFSM6AAAAABTJJBU32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBZGA2DGMJZGM].
You are receiving this because you were mentioned.
[Image de pistage][https://github.com/notifications/beacon/AAUGXW4AFPAGDCQUWVJYL7L3ALMJZA5CNFSM6AAAAABTJJBU32WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVNMR47S.gif]
|
Recently Pocket changed the format of their data export function, switching from HTML files to a zipped folder containing CSV files, delivered in parts of up to 10000 bookmarks.
Other bookmark managers were also affected by this, as seen here: karakeep-app/karakeep#570
This patch allows the
pocketsub-command to handle these files correctly, expanding it's functionality to import both HTML and CSV files, as I believe the ability to import older exports may still be useful. This is done by a simple file extension check, which I think will suffice for most users.Note that the command still does not process the multiple part files explicitly, so the user has to import them one by one, which I don't think will be too much of a hassle for the user either way. :)
I would appreciate it if someone could test this patch on an older HTML file (or give me one so I could test it myself :3), as I was only able to test it with my own CSV export.