Problems with piping and other stdout redirection
ptp search "https://passthepopcorn.me/collages.php?id=2438" order_by=addedon order_way=desc grouping=yes runs with no problem.
However, when you want to pipe it to something like for example head or tail, things get broken (e.g. ptp search "https://passthepopcorn.me/collages.php?id=2438" order_by=addedon order_way=desc grouping=yes | grep imdb
Below is a trace
ubuntu@inclusive-seriema:~$ ptp search "https://passthepopcorn.me/collages.php?id=2438" order_by=addedon order_way=desc grouping=yes | grep imdb
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/ptp", line 11, in <module>
load_entry_point('PTPAPI==0.5', 'console_scripts', 'ptp')()
File "/home/ubuntu/.local/lib/python2.7/site-packages/ptpapi/scripts/ptp.py", line 341, in main
args.func(api, args)
File "/home/ubuntu/.local/lib/python2.7/site-packages/ptpapi/scripts/ptp.py", line 114, in do_search
search_page(api, args, target, movies, torrents, terms.copy())
File "/home/ubuntu/.local/lib/python2.7/site-packages/ptpapi/scripts/ptp.py", line 174, in search_page
print(torrent_template.substitute(torrent))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 25-36: ordinal not in range(128)
Looks like this might have something to do with me running my script within a multipass VM
If this is still an issue, I can probably force things to decode as UTF-8, since that's all the site should ever support.
Closing as stale, feel to re-open if it's still an issue.