More results per page / Change order

Issue #110 wontfix
Hosted created an issue

Dear developers,

It would be really good if we could choose how many results per page we'd like to see as currently the number returned is too low (around 10 per page) which makes it hard when there are many videos available.

I also tried changing the video_page_size and size_videos settings on scraper.py but that didn't have any effect.

It also would be really good if we could invert the order of results from the oldest to the newest instead of the current setting (most recent to oldest)

Thank you very much in advance.

Comments (9)

  1. Bruno Briner

    Dear Hosted,

    Check if you are using the latest version of the addon. If you are not, please update it or full re-install it.

    The addon should get all separated videos from the newest date listing them in ascending order, i.e. oldest to newest, The list of videos should be identical to the GloboPlay app. In summary the order follows the full program how it was aired.

    Taking "Fantastico" from the 19th of June as example you should have a list as follows, all in one page.

    https://api.globoplay.com.br/v1/programs/814/videos?day=2016-06-19&order=asc&page=1&api_key=4c3f033123840f740508ec49e89e5142 https://api.globoplay.com.br/v1/programs/814/videos?day=2016-06-19&order=asc&page=2&api_key=4c3f033123840f740508ec49e89e5142 https://api.globoplay.com.br/v1/programs/814/videos?day=2016-06-19&order=asc&page=3&api_key=4c3f033123840f740508ec49e89e5142

  2. Hosted reporter

    Dear Bruno, Thanks for getting back to me. I am using the latest version indeed. Let me try to explain it better. Let's say "Fantastico" has 50 videos being the newest 2016-06-21 and the oldest 2013-01-01

    When opening the addon and going to "Fantastico" it will list only 10 videos per page and the first one will be 2016-06-21. I'd like to be able to:

    1) increase the number of videos per page (e.g. 100) 2) start with the oldest video 2013-01-01

    How would the above be able to be accomplished?

    Thanks again

  3. Bruno Briner

    Dear Hosted,

    First things first, when opening the addon and going to "Fantastico" you should see not only 10 videos per page, you should see the complete list of videos for a given date. In the 2016-06-19 "Fantástico" edition you should get 22 videos in the following order. In summary if a given date of a given program has 3 videos the addon should list 3 videos, if it contains 30 videos it should list 30 videos, there is no limitation of 10 videos.

    "Fantástico, Edição de 19/06/2016"

    "Bebê perde mãe com 15 dias comove web com mutirão por leite materno"

    "Polícia foi avisada de plano para resgatar traficante em hospital no Rio"

    "Flórida tem um milhão de jacarés, mas ataques não são comuns"

    "Ideal pra Você: descubra o resultado da experiência com 75 voluntários"

    "Detetive Virtual investiga vídeo que mostra pinto nascendo fora do ovo"

    "Ex-encanador inglês faz sucesso com invenções e vídeos na internet"

    "Me Conta Lá no Quarto: Joana precisa lidar com mãe durona; Christian ajuda"

    "José Loreto tem dia de lutador com José Aldo no \"Repórter por um dia\""

    "Embarque na jornada de fé e coragem de padre Fábio de Melo na Palestina"

    "Papa Francisco pede paz para aqueles que perderam os lares por causa de guerras"

    "Click Esperança: Tatá Werneck, Taís Araújo, Leifert e Huck entram em ação"

    "Tocha Olímpica segue o seu caminho pelo Brasil"

    "Geração 2016: jogador de basquete do Toronto Raptors relembra origem"

    "Nico Rosberg vence o GP da Europa de F1 nas ruas de Baku, no Azerbaijão"

    "A cada 28 horas, um homossexual morre de forma violenta no Brasil"

    "Odebrecht teria departamento criado só para pagar propina, segundo MP"

    "Mineradora de ouro às margens do rio Xingu pode causar danos ao ambiente

    "Prefeito do Rio afirma que dinheiro gasto para Olimpíada não tem relação com crise"

    "Ney Matogrosso presta homenagem a Gonzaguinha com 'Explode Coração'"

    "Saiba quem são os dez criminosos mais procurados pela Interpol no país"

    "Confira os gols do Brasileirão Série A"

    Note the difference from your screenshot, you got the first video (the "Integra") and later the ones starting from the latest "Confira os gols do Brasileirão Série A", etc. YOUR addon is getting the 10 videos from the API call https://api.globoplay.com.br/v1/programs/814/videos?day=2016-06-19&order=desc&page=1&api_key=4c3f033123840f740508ec49e89e5142 that is not what is coded in the latest 0.1.32 version. The list of videos from your screenshot was from the addon version of 0.1.23 IIRC. What might be happening in your case is that parts of the addons were not updated (scraper.py perhaps) whereas others did so it is worth manually deleting the addon files and re-installing it just to be sure. :)

    Hitting "Previous Day" you should get the complete list again of the previous day. To note the complete list of available days for "Fantastico" is returned with the following API call: https://api.globoplay.com.br/v1/programs/814/videos/days?api_key=4c3f033123840f740508ec49e89e5142

    Second: Some programs, and "Fantastico" is probably the best example, has too many available days (not videos), if you hit the previous link you will see that the oldest available videos date from 1974! Furthermore 100 videos is probably just a few months away for programs containing large amounts of videos like Fantastico anyway, and such modification would make the addon useless for the ones who want to watch the latest editions of the programs. Imagine you selecting "Fantastico" starting with videos from 1974 having to hit "Next Page" over and over again (and waiting for the addon to scrape the next 100 videos) in order to watch the latest Sunday edition.

    A compromise would be to code in the addon to list all available days like in https://api.globoplay.com.br/v1/programs/814/videos/days?api_key=4c3f033123840f740508ec49e89e5142 and then upon user selection scrape the list of videos. Unfortunately my Python knowledge is very limited so you might request such implementation to someone with way more knowledge like @lucasrokam.

  4. Hosted reporter

    Dear Bruno,

    I really appreciate your time to provide this very detailed explanation. I'll be downloading shortly the latest version and pushing it manually so I have the most up to date parts and check everything out.

    I totally understand your last comment and I was actually not asking for this behavior to be the norm but just to have the option to do so if desired. It could even be done manually and directly on the script if available.

    There are some categories (e.g. "Novelas") that haven't been watched when it first aired and because of that it would be very helpul to start from the first video to the last, if you know what I mean.

    Would you please advise how I can reassign this request to Lucas?

    Btw, congrats to all of the team. This addon is "Fantástico!" :-)

    Best

  5. Hosted reporter

    I was able to edit the request and assign it to Lucas.

    @lucasrokam, please let me know if you need any further clarification and thank you very much in advance!

  6. Hosted reporter

    Hi @lucasrokam,

    I am following up to know your comments about this. Please let me know.

    Thanks

  7. Lucas Andrade

    @hostedvrn enable more results then what is returned by the json request won't be implemented. Although I can add a feature to choose what kind of sort do you want for the dates. I might have an issue as Globo Play and Globosat Play are different and I need to integrate them in the same interface.

  8. Log in to comment