EchterAlsFake / PHUB

A lightweight API for Pornhub
https://phub.rtfd.io
GNU General Public License v3.0
75 stars 25 forks source link

IndexError: list index out of range #30

Closed slavikfoxy closed 11 months ago

slavikfoxy commented 12 months ago

import phub import codecs import shutil

from phub.locals import * client = phub.Client('login', '1')

for i, video in enumerate(client.account.watched): print(f'{i}. {video.image.url}') END CODE

Traceback (most recent call last): File "C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH.py", line 10, in for i, video in enumerate(client.account.liked): File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 104, in next return self.get(self.iter_index) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 127, in get page = self._get_page(index // self.PAGE_LENGTH) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 169, in _get_page return self._parse_page(raw) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 271, in _parse_page container = raw.split('class="container')[1] IndexError: list index out of range

Egsagon commented 12 months ago

Hi, I'm not able to replicate the issue. What PHUB version are you using? Does your account history page renders correctly on your browser? Do you have a watch history on this account? If yes, does it contains videos?

slavikfoxy commented 12 months ago

Hi, I'm not able to replicate the issue. What PHUB version are you using? Does your account history page renders correctly on your browser? Do you have a watch history on this account? If yes, does it contains videos?

sorry, I wrote it wrong, {video.image.url} is causing an error print(f'{i}. [{video.key}] "{video.title}" {video.image.url}')

  1. [6464ea54e7e5b] "My little pussy is so wet I need a dick!" https://ei.phncdn.com/videos/202305/17/431734671/original/(m=eaf8Ggaaaa)(mh=e_dBkwjfqYzgdn2Q)11.jpg
  2. [ph613d210782e21] "WATCH ME COME - CANDICE DELAWARE" https://ei.phncdn.com/videos/202109/11/394540511/original/(m=eaf8Ggaaaa)(mh=8vaFPWRIWFvpF4D_)11.jpg
  3. [ph63c6a13e45ad1] "I have sex with a big cock doll" https://ei.phncdn.com/videos/202301/17/423532632/original/(m=eaf8Ggaaaa)(mh=luIvglundn2czF1T)15.jpg
  4. [64f21c5dc15f5] "Runa feels naughty with black toy Sia Siberia" https://ei.phncdn.com/videos/202309/01/438576871/original/(m=eaf8Ggaaaa)(mh=P3Nk6EeAZ9JKOJTY)16.jpg
  5. [64fa4aebc3975] "Camera in Vagina, Fingering, Cervix POV" https://ei.phncdn.com/videos/202309/07/438983241/thumbs_3/(m=eaf8Ggaaaa)(mh=QxJdCIIUNnTzGXmq)15.jpg
  6. [655b2a5e17663] "Busty Try not get Caught Masturbating at friends house" https://ei.phncdn.com/videos/202311/20/443322611/original/(m=eaf8Ggaaaa)(mh=NfYEsgXYSYWg5y9_)3.jpg
  7. [655c686923f38] "【女子大生】合法JOがえちえちオナニーしてみた///" https://ei.phncdn.com/videos/202311/21/443379781/original/(m=eaf8Ggaaaa)(mh=03HDreKOHQ5jWVbW)13.jpg
  8. [655e1658b1e2c] "Up Green Skirt - Tight Pussy - Extremely Thick Dildo- Pee Orgasm" https://ei.phncdn.com/videos/202311/22/443456631/original/(m=q7HZ81Ybeaf8Ggaaaa)(mh=0TNVqbbjySqMjXf9)0.jpg
  9. [655e1d6277665] "playing with freshly shaved pussy" https://ei.phncdn.com/videos/202311/22/443457231/original/(m=eaf8Ggaaaa)(mh=IIJkV-njFPbz7BJi)3.jpg
  10. [655fc5f46965f] "女装 子|crossdresser【日本人cosplayer】momo アニメコスでオナニー" https://ei.phncdn.com/videos/202311/23/443533821/original/(m=eaf8Ggaaaa)(mh=soa7f8M1eNxB3rtj)11.jpg
  11. [655fd8a442c3d] "女装 子|crossdresser【日本人cosplayer】黒タイツ越しに出ちゃった FC限定オナニー動画ちら見せ" https://ei.phncdn.com/videos/202311/23/443537431/original/(m=eaf8Ggaaaa)(mh=9Hr480uOtUFNlVo5)12.jpg
  12. [6560ec9b96137] "女装 子|crossdresser【日本人cosplayer】お漏らししちゃいました、、 | FC限定オナニー動画ちら見せ" https://ei.phncdn.com/videos/202311/24/443582951/original/(m=eaf8Ggaaaa)(mh=kWqvnxHzyivT1ci8)9.jpg
  13. [6560f59535acf] "女装 子|crossdresser【日本人cosplayer】momoサンタクロース | FC限定オナニー動画ちら見せ" https://ei.phncdn.com/videos/202311/24/443584531/original/(m=eaf8Ggaaaa)(mh=3H3DE_kheENq8BCZ)8.jpg
  14. [6561003858fe0] "女装 子|crossdresser【日本人cosplayer】えっちなチャイナ服でシコシコおなにー... | FC限定オナニー動画ちら見せ" https://ei.phncdn.com/videos/202311/24/443586211/original/(m=eaf8Ggaaaa)(mh=0gYKMmm5SvTty07m)7.jpg
  15. [6560f93f42852] "女装 子|crossdresser【日本人cosplayer】ミニスカ巫女のおもらしオナニー | FC限定オナニー動画ちら見せ" https://ei.phncdn.com/videos/202311/24/443585101/original/(m=eaf8Ggaaaa)(mh=s-Rq-ch_x52zi1I_)7.jpg
  16. [ph637769e4ead9b] "Relax to the Sounds of Nylon and a wet Pussy / ASMR" https://ei.phncdn.com/videos/202211/18/419780521/thumbs_5/(m=eaf8Ggaaaa)(mh=jr4P4gYdeahnSICS)9.jpg
  17. [6513e8da37fa5] "fingering my virgin ass and teasing you with cat tail butt plug" https://ei.phncdn.com/videos/202309/27/440184801/thumbs_14/(m=eaf8Ggaaaa)(mh=sl34ghrmAlg2oYQ_)15.jpg
  18. [65614f92db9a5] "Samantajhons Jugando rico" https://ei.phncdn.com/videos/202311/25/443602231/original/(m=eaf8Ggaaaa)(mh=5NqaQEhuFUJzHcfo)13.jpg
  19. [65618ca37892e] "[Amateur Japanese] Chikney and masturbation in uniform! It felt so good that I moved my hips a lot ♡" https://ei.phncdn.com/videos/202311/25/443609981/original/(m=eaf8Ggaaaa)(mh=O_4qlYECx6SJUCiI)10.jpg
  20. [6562c9af3cd48] "ASMR Roleplay: Tifa Lockhart masturbates with panties in her pussy and mouth to gift them to you!" https://ei.phncdn.com/videos/202311/26/443661771/original/(m=q4K3M2Ybeaf8Ggaaaa)(mh=YnNit8ofJoB6Wvew)0.jpg
  21. [6559ca1d14607] "【ginger姜姜】芭蕾体服舞蹈生自慰高潮把厚白丝全部打湿~尿一裤子" https://ei.phncdn.com/videos/202311/19/443264481/original/(m=eaf8Ggaaaa)(mh=gAQrKhAfcIym-_g0)12.jpg
  22. [65611171cf78d] "Neko hentai egirl licks her own nipples" https://ei.phncdn.com/videos/202311/24/443590611/original/(m=eaf8Ggaaaa)(mh=el8oFy6IhRp4jGRK)8.jpg
  23. [6560f97122562] "Married woman in cosplay masturbate her tight pussy with a big dildo - close up" https://ei.phncdn.com/videos/202311/24/443585531/original/(m=eaf8Ggaaaa)(mh=jsmmF_Y48e0s1zHX)6.jpg
  24. [6560deeca6741] "Eeeve Pokémon Cosplay" https://ei.phncdn.com/videos/202311/24/443580041/original/(m=eaf8Ggaaaa)(mh=CxCng-x-xd-5vlep)13.jpg
  25. [6560cfc43852d] "Arknights Footjob & anal by Lappland Sia Siberia" https://ei.phncdn.com/videos/202311/24/443577201/original/(m=eaf8Ggaaaa)(mh=ixpLfspPTm0kcROg)9.jpg
  26. [6560b8f25eb93] "HERMANASTRA ME HACE UNA VIDEO LLAMADA Y ME MUESTRA SU GRAN COÑO" https://ei.phncdn.com/videos/202311/24/443572571/original/(m=eaf8Ggaaaa)(mh=u2Ctqj5n4fWint5s)3.jpg
  27. [65609a455c811] "Crazy slut Shego rides HUGE dildo until squirt and take it into her tight asshole and OPEN IT WIDE!" https://ei.phncdn.com/videos/202311/24/443567711/original/(m=q8_QJ2Ybeaf8Ggaaaa)(mh=cskrWz9J1lDiXb2F)0.jpg
  28. [64f2a945d7afd] "モザイク薄め♡スマホ縦画面♡大好きな電マ押し当てオナニー♡" https://ei.phncdn.com/videos/202309/02/438602741/original/(m=eaf8Ggaaaa)(mh=kQz0__Fjw1IqFctQ)10.jpg
  29. [649d25f89815f] "I masturbate after taking a bath. I'm obsessed with rubbing my clitoris." https://ei.phncdn.com/videos/202306/29/434495711/original/(m=eaf8Ggaaaa)(mh=rEVXvvuAb6xb4y_c)3.jpg
  30. [655c962c543ec] "クチュクチュと音を出しながらオナニー。" https://ei.phncdn.com/videos/202311/21/443387721/original/(m=eaf8Ggaaaa)(mh=k-ehMP8TqvCtq5tU)16.jpg
  31. [65096d2ee8d6e] "猫娘の発情期♡しっぽの付け根とんとんしてください...♡" https://ei.phncdn.com/videos/202309/19/439699951/original/(m=eaf8GgaaaWavb)(mh=OSrWyJAmtw7FX37M)7.jpg
  32. [655b286555725] "Cute girl masturbating alone with adult toys." https://ei.phncdn.com/videos/202311/20/443324041/original/(m=eaf8Ggaaaa)(mh=ViKZzMOu_W8ZENIw)16.jpg
  33. [655d1d7bd5de9] "Minnie Mouse footplay in white toe-reinforced stockings and high heels" https://ei.phncdn.com/videos/202311/21/443415501/original/(m=eaf8Ggaaaa)(mh=GL-m_0HhJvRvowN_)10.jpg
  34. [65592b9322257] "Mitsuri Kanroji cosplay and oil show." https://ei.phncdn.com/videos/202311/18/443238661/original/(m=eaf8Ggaaaa)(mh=Kv51gd8EqOdnXZtH)8.jpg
  35. [6558a42d259a6] "Foot Porn ASMR Lady Rosalie" https://ei.phncdn.com/videos/202311/18/443213881/original/(m=eaf8Ggaaaa)(mh=pN85PYRA5iNZ5aCx)2.jpg
  36. [64cca82f75c04] "I masturbated so that I could look up from below with a white apron and a dildo given to me by a Twi" https://ei.phncdn.com/videos/202308/04/436766751/original/(m=eaf8Ggaaaa)(mh=hnxN-yru_IFVY7kE)8.jpg
  37. [655843eeb697f] "College girl masturbates with dildo in sexy fishnet stockings and cums |Japanese uncensored" https://ei.phncdn.com/videos/202311/18/443201451/original/(m=qN0H01Ybeaf8Ggaaaa)(mh=WklL1NSBlA1yXFUi)0.jpg
  38. [655847713cf4e] "JK uniform girl masturbates so much that her pussy can't stop convulsing Uncensored ,Japanese Uncens" https://ei.phncdn.com/videos/202311/18/443201931/original/(m=qW_H01Ybeaf8Ggaaaa)(mh=9EbULYelMYhAP83s)0.jpg
  39. [65626f8bdda71] "Watch me play with myself" https://ei.phncdn.com/videos/202311/25/443647881/original/(m=eaf8Ggaaaa)(mh=fov71d79dYXcldp-)6.jpg
  40. [6562110b7e201] "Pierced Pink Shaved Pussy Squirting On Edge Of Bathtub In Dress Shirt Socks" https://ei.phncdn.com/videos/202311/25/443628411/original/(m=eaf8Ggaaaa)(mh=N-SeXNQJ8ATt2n1f)2.jpg
  41. [65620bd339dbf] "Sweater Paws" https://ei.phncdn.com/videos/202311/25/443627431/original/(m=eaf8Ggaaaa)(mh=-Yauti7rgejOEjcm)7.jpg
  42. [6561c7fe322ad] "Orange Babe Preparing Her Sweet Juice" https://ei.phncdn.com/videos/202311/25/443617761/original/(m=qS26K2Ybeaf8Ggaaaa)(mh=jfGwtzelT1Gbz3Wu)0.jpg
  43. [6561af77df0f9] "POV Bubble Butt - Red Upskirt - Close Up Huge Squirt" https://ei.phncdn.com/videos/202311/25/443614731/original/(m=qI36K2Ybeaf8Ggaaaa)(mh=mrm0oCaCHgpAsP66)0.jpg
  44. [63eaca38921eb] "Miku Fucks Herself With A Cucumber" https://ei.phncdn.com/videos/202302/13/425419821/original/(m=q7S84_Xbeaf8Ggaaaa)(mh=pEZnm8XoZ-S7XKGC)0.jpg
  45. [ph5db097b2ea1ae] "Nezuko Kamado Demon Slayer Kimetsu Masturbate cosplay  moaning" https://ei.phncdn.com/videos/201910/23/256767892/original/(m=eaf8Ggaaaa)(mh=t10yfiM1bfoOtdbi)11.jpg
  46. [63db915bf0060] "Komi san masturbates through pantyhose for you" https://ei.phncdn.com/videos/202302/02/424637361/thumbs_5/(m=eaf8Ggaaaa)(mh=IA85o6VDis8HcppX)1.jpg
  47. [ph5eecd0279ee31] "Eruru the Succubus bikini" https://ei.phncdn.com/videos/202006/19/325127571/thumbs_1/(m=eaf8Ggaaaa)(mh=kmph8VC_DwpneG1B)2.jpg
  48. [ph5e5e31ff0635f] "Rem cosplay wet ass pussy POV verified sexy teen" https://ei.phncdn.com/videos/202003/03/289543902/original/(m=eaf8Ggaaaa)(mh=82oLlwAH8DUcMm9g)8.jpg
  49. [ph613aa9eba216c] "REM fucks two holes.💙Double penetration🍆🍆💦" https://ei.phncdn.com/videos/202109/10/394441421/original/(m=eaf8Ggaaaa)(mh=2T835QdIjpg7MiPv)5.jpg
  50. [63f6499307a5c] "Jinx from League of Legends cums from vibrators and dildo in her pussy" https://ei.phncdn.com/videos/202302/22/426017151/thumbs_10/(m=eaf8Ggaaaa)(mh=4NOy95slGpefkH0t)1.jpg
  51. [ph620291487c184] "Rem cum twice from big dildo" https://ei.phncdn.com/videos/202202/08/402728131/original/(m=eaf8Ggaaaa)(mh=klZT4Po3tTVzfKZ-)13.jpg
  52. [ph608ae7c340719] "Rem (Re:zero) gets pussy fucked orgasm" https://ei.phncdn.com/videos/202104/29/387316221/thumbs_10/(m=eaf8Ggaaaa)(mh=AhCFJ99zBzqmm_5M)5.jpg
  53. [ph5ea0330138c2b] "extra creamy webcam slut zzzirael fucking herself" https://ei.phncdn.com/videos/202004/22/306286041/original/(m=eaf8Ggaaaa)(mh=5sRZmZJ3xxQCM144)8.jpg
  54. [ph5e317e4c544b4] "Princess Elizabeth Rides A Dildo And Cums Squirt" https://ei.phncdn.com/videos/202001/29/280294101/original/(m=qNLJJJVbeaf8Ggaaaa)(mh=-FwQf_pW4JuelC1f)0.jpg
  55. [ph5d64c91679781] "Pie Tries to Get Lucky Preview" https://ei.phncdn.com/videos/201908/27/244391911/original/(m=eaf8Ggaaaa)(mh=kCsdLa4FLoVAMg-S)14.jpg
  56. [ph63afcff7bc370] "The cutie asks to fuck her hard" https://ei.phncdn.com/videos/202212/31/422394761/original/(m=eaf8Ggaaaa)(mh=M0svtBqBYFw4P8n6)12.jpg
  57. [ph61ad2d1b8f2be] "Rei Ayanami gets horny and cums with a dildo and vibrator" https://ei.phncdn.com/videos/202112/05/399185241/original/(m=eaf8Ggaaaa)(mh=eIKM9SpwQd-ukdCD)8.jpg
  58. [6467cdec64b0c] "Bulma and Vegeta’s Cock Cosplay Dildo Review - Lana Bee" https://ei.phncdn.com/videos/202305/19/431884061/original/(m=eaf8Ggaaaa)(mh=XjBIzNkmhHt6bYoy)10.jpg
  59. [64f802c1ca7ec] "I have one rule: you shouldn't cum before 15 minutes. JOI, Countdown, Challenge" https://ei.phncdn.com/videos/202309/06/438866211/original/(m=eaf8Ggaaaa)(mh=5JTb6fFtVZPBP8l-)10.jpg
  60. [65298d43ad7e1] "Fuck Machine Compilation Cosplay Pet Play" https://ei.phncdn.com/videos/202310/13/441152291/original/(m=eaf8Ggaaaa)(mh=V0on96C59Jvojmv9)9.jpg
  61. [ph626a9e2ef36e6] "Teen girl cums with a huge dildo ~ pee" https://ei.phncdn.com/videos/202204/28/407157841/thumbs_5/(m=eaf8Ggaaaa)(mh=FVhOItgJO51GU0UG)12.jpg
  62. [63d63b7175d17] "Kuriyama Mirai plays with toys and fucks pussy! Kyoukai no Kanata" https://ei.phncdn.com/videos/202301/29/424350941/thumbs_5/(m=eaf8Ggaaaa)(mh=uEas1eSpZlDqVcRx)1.jpg
  63. [6524b67233c73] "Cute Neko Kitten Ears and Tail Plug Cam Girl Orgasms with Dildo and Lovense Domi Vibrator" https://ei.phncdn.com/videos/202310/10/440928641/original/(m=eaf8Ggaaaa)(mh=1wnXeBo9I1pX-obj)5.jpg
  64. [642fd95b79133] "My favourite "Sohimi Toy"! Marin Kitagawa" https://ei.phncdn.com/videos/202304/07/429043131/thumbs_10/(m=eaf8Ggaaaa)(mh=mL9asmoogkWtmybk)3.jpg Traceback (most recent call last): File "C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH.py", line 10, in for i, video in enumerate(client.account.watched): File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 104, in next return self.get(self.iter_index) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 127, in get page = self._get_page(index // self.PAGE_LENGTH) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 169, in _get_page return self._parse_page(raw) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 271, in _parse_page container = raw.split('class="container')[1] IndexError: list index out of range
Egsagon commented 12 months ago

Can you provide the url or viewkey of the video that raises this error?

slavikfoxy commented 12 months ago

the error occurs on 64 videos tried client.account.watched and client.account.liked the code works correctly without {video.image.url}

print(f'{i}. "{video.title}" ')

Output ......

  1. "Leah Vause shows off her fox tail plug"
  2. "Showing off Tail plug Short Clip"
  3. "Gaping cunt and cervix show"
  4. "Yoga Pants + Panty Stuffing"
Egsagon commented 12 months ago

Can you do something like:

for i, video in enumerate(client.account.watched):
    try:
       video.image.url
    except:
        print(video.key)

This will list all keys of the videos with this bug

slavikfoxy commented 12 months ago

= RESTART: C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH.py Traceback (most recent call last): File "C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH.py", line 10, in for i, video in enumerate(client.account.watched): File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 104, in next return self.get(self.iter_index) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 127, in get page = self._get_page(index // self.PAGE_LENGTH) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 169, in _get_page return self._parse_page(raw) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 271, in _parse_page container = raw.split('class="container')[1] IndexError: list index out of range

slavikfoxy commented 12 months ago

I found another error in query.py file line 248 PAGE_LENGTH = 32, i get 3735 videos, if i change to 40 - 4663 videos 42 - 4895. i am looking for the number at which all my videos will be - 5592

Egsagon commented 12 months ago

Can you please execute the code i have provided and copy its result so i can debug it on my end.

Concerning the second error, fixed page length is a flaw in the query structure anyway. I will look into it.

slavikfoxy commented 12 months ago

Чи можете ви виконати наданий мною код і скопіювати його результат, щоб я міг налагодити його самостійно.

Що стосується другої помилки, фіксована довжина сторінки все одно є недоліком у структурі запиту. Я розгляну це.

import phub

from phub.locals import * client = phub.Client('123@', '321')

for i, video in enumerate(client.account.watched): try: video.image.url except: print(video.key)

OUTPUT Traceback (most recent call last): File "C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH2.py", line 6, in for i, video in enumerate(client.account.watched): File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 104, in next return self.get(self.iter_index) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 127, in get page = self._get_page(index // self.PAGE_LENGTH) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 169, in _get_page return self._parse_page(raw) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\query.py", line 271, in _parse_page container = raw.split('class="container')[1] IndexError: list index out of range

Egsagon commented 12 months ago

Sorry, i don't understand your error. Is it with video.image.url or client.account.watched? If the last error you posted is related to client.account.watched, where comes the output from https://github.com/Egsagon/PHUB/issues/30#issuecomment-1830218922 ?

slavikfoxy commented 12 months ago

the video.image.url argument causes an error after 64 videos, for example, video.tags does too, but {video.key} and {video.title} do not

slavikfoxy commented 12 months ago

import phub

from phub.locals import * client = phub.Client('12356@', '88555444')

for i, video in enumerate(client.account.watched): print(f'{i}. "{video.title}" {video.tags}') image ... print(f'{i}. "{video.title}" {video.image.url}') image

... print(f'{i}. "{video.title}" ') image

Egsagon commented 12 months ago

video.image.url and video.tags require PHUB to directly fetch the video, whether using HubTraffic or web scrapping the video page. I wasn't able to replicate your issue with none of my accounts. The only issue i get is PH servers spam protection, which, unlike your error, raises a requests.exceptions.ConnectionError exception. Therefore, i assume your error is due to PH blocking you for too many requests. There is a chance that PH sent you its challenge page for you to slow down, which was the issue in #5. However this has been de-implemented since i thought they removed it. Before i add it back however, see if adding a delay fixes your error. Use the built-in client delayer.

...
client = phub.Client('username', 'password', delay = .5)
...

Alternatively, but i doubt this is the issue, check your PHUB version and try to update it.

slavikfoxy commented 12 months ago

Thank you, it worked image

slavikfoxy commented 12 months ago

received a new error .......

  1. "Schoolgirl learns how to cum from anal"
  2. "18 Girl tits massage hands and vibrator at pajama's party kigurumi nipple masturb"
  3. "Weeb teen play with pussy and cum hard after school"

Traceback (most recent call last): File "C:\Users\oliyn\OneDrive\Documents\PYTHON PROJEKT\import PH.py", line 12, in f.write(f' [{video.key}] "{video.title}" {video.image.url}\n') File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\functools.py", line 995, in get val = self.func(instance) File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\video.py", line 248, in image url = self.fetch('data@thumb'), File "C:\Users\oliyn\AppData\Local\Programs\Python\Python312\Lib\site-packages\phub\objects\video.py", line 107, in fetch self.data |= {f'data@{k}': v for k, v in data['video'].items()} KeyError: 'video'

Egsagon commented 12 months ago

This error probably comes from Pornhub refusing to send the video data. This is usually the case when a video has become private or has been deleted, which can happen if you are iterating through an history. I will implement error handling for this in PHUB, so the error is more explicit.

I will also probably implement a util that allows to iterate through a query without raising this type of error (like contextlib.suppress) or put it directly inside queries generators.

Lastly, concerning your first error fixed with the delayer, i still believe that is because of the PH challenge. I will also reimplement it at the scale of the client calls.

slavikfoxy commented 12 months ago

I found another error in query.py file line 248 PAGE_LENGTH = 32, i get 3735 videos, if i change to 40 - 4663 videos 42 - 4895. i am looking for the number at which all my videos will be - 5592

I can't get the full list of my videos, I tried changing the parameter PAGE_LENGTH = 32, each time I get a different number of videos.

Egsagon commented 11 months ago

This error probably comes from Pornhub refusing to send the video data. This is usually the case when a video has become private or has been deleted, which can happen if you are iterating through an history.

I have implemented a VideoError exception that raises when this happens. Since most of the time you want to ignore these errors, i have implemented a suppress function that ignore errored videos and pass on to the next one.

import phub
from phub.utils import suppress

client = phub.Client(...)

for video in suppress( client.account.watched ):
    print(video.key, video.image.url)

I can't get the full list of my videos, I tried changing the parameter PAGE_LENGTH = 32, each time I get a different number of videos.

This is a regex problem, it will take its time.

Egsagon commented 11 months ago

I found another error in query.py file line 248 PAGE_LENGTH = 32, i get 3735 videos, if i change to 40 - 4663 videos 42 - 4895. i am looking for the number at which all my videos will be - 5592

Please update PHUB from this repository and tell me if c063d0c fixes the error.