MajkiIT / polish-ads-filter

CertyficateIT - Oficjalne polskie filtry do Adblock, uBlock Origin, Adguard
Other
671 stars 93 forks source link

player.pl przy pomoczy adblockprotector #2205

Closed xxcriticxx closed 7 years ago

xxcriticxx commented 7 years ago

@MajkiIT zachenc kolege do donation na https://patronite.pl/polskiefiltry. juz napisalem do AdBlockProtector z pytaniem czy da sie cos zrobic

Marcin Kijowicz napisal na fb:

Czy jest szansa na odblokowanie filmów na portalu "player.pl" przy pomocy "Adblock Protector"?

xxcriticxx commented 7 years ago

@MajkiIT or @F4z need polish ip for @X01X012013 to test player.pl can someone help?

mathew85 commented 7 years ago

Tak przy okazji to player.pl działa z AdGuard for Windows: https://forum.adguard.com/index.php?threads/resolved-player-pl.19371/#post-125569

Co do IP to może można zrzucić się na jakiegoś VPNa.

xxcriticxx commented 7 years ago

@mathew85 by pasowalo jakies proxy w domu bo jest duzo testowania @MajkiIT moze cos zalatwi

xxcriticxx commented 7 years ago

@F4z przetestujesz czy to co podal @mathew85 dziala z adguardem? tak samo czy da rade ktos przetwstowac player.pl z adblockprotector.

F4z commented 7 years ago

@xxcriticxx z Adguardem w wersji dla Windowsa player.pl działa bez reklam. Za jakieś 10-30 minut sprawdzę z adblockprotectorem.

MajkiIT commented 7 years ago

@xxcriticxx Ok coś ogarnę. Prędzej jakieś proxy zrobię dla niego.

F4z commented 7 years ago

Z AdBlockProtectorem nie działa mi prawidłowo.

Tutaj nie wyświetla się w ogóle film - http://player.pl/programy-online/milionerzy-odcinki,5045/odcinek-6,S00E06,70551.html?atpl#play

image

Tutaj jest tylko 30 sekund (pewnie wyświetla tylko zwiastun zamiast samego filmu) i nieprawidłowo się wyświetla - http://player.pl/seriale-online/na-wspolnej-odcinki,144/odcinek-2425,S00E2425,70050.html?atpl#play

image

Swoją drogą szymon1118 podał tutaj rozwiązanie, które działało (i z tego co na szybko sprawdziłem to nadal działa) w większości przypadków (nie działało chyba tylko przy filmach 360°) - https://github.com/X01X012013/AdBlockProtector/issues/23#issuecomment-261581585

jspenguin2017 commented 7 years ago

@F4z Usually I don't support Geo Lock bypassing, but for the sake of testing my broken code, I'll try it.

xxcriticxx commented 7 years ago

@X01X012013 adguard on windows still works but adblockprotector doesn't work

jspenguin2017 commented 7 years ago

OK, second test link is fixed in 6.35, could not find video source for first test link... @szymon1118 Can you have a look?

F4z commented 7 years ago

@X01X012013 thank you, is better, but still it is not good, because it plays only trailer (30 seconds), not full video. I think they use something, to protect their video, but I could be wrong.

Maybe it will be helpful: http://player.pl/playlist-vod/icc/70552.json?uaq562 http://n-2-12.dcs.redcdn.pl/dash/o2/tvnplayer/vod/17_400_22545_0007/SMOOTH_HD/723726f7-4212-430c-a03c-a7b38f3fddd9/Manifest.ism

By the way, script from here https://github.com/X01X012013/AdBlockProtector/issues/23#issuecomment-261581585 still works for most videos, only 360 degree videos do not work.

 tvn_pl : {
        // by: Reek, Marek
        // solution: http://tinyurl.com/ohbvz4r, http://tinyurl.com/jq8s462
        // issue: https://github.com/reek/anti-adblock-killer/issues?q=tvn.pl
        // issue: https://github.com/reek/anti-adblock-killer/issues?q=tvn24.pl
        // issue: https://github.com/reek/anti-adblock-killer/issues?q=player.pl
        // test: http://tinyurl.com/o6d9h66, http://tinyurl.com/z77m4zh
        host : ['tvn.pl', 'tvn24.pl', 'player.pl'],
        onEnd : function () {
          Aak.hasElement('header.detailImage', function (thisElement) {
            // if (Aak.getCookie('country_code') && Aak.getSession('generateToken')) {
                var parts = document.location.href.split(/[.,]/);
                var id = parts[parts.length - 2];
                var params = {
                  platform : "ConnectedTV",
                  terminal : "Panasonic",
                  format : "json",
                  authKey : "064fda5ab26dc1dd936f5c6e84b7d3c2",
                  v : "3.1",
                  m : "getItem",
                  // type : "episode",
                  id : id,
                  // sort : "newest",
                  // deviceScreenHeight : 1600,
                  // deviceScreenWidth : 2560
                };
                var api = 'https://api.tvnplayer.pl/api/?' + Aak.serialize(params);
                var proxy = 'http://www.proxy.xmc.pl/index.php?hl=3e5&q=';

                // Get videoUrl
                Aak.request({
                  url : Aak.getCookie('tvn_location2') != 1 ? proxy + Aak.encodeURI(api) : api,
                  // url : api,
                  /*headers : {
                    "User-Agent" : "Mozilla/5.0 (Linux; U; Android 4.2; en-us; Nexus 10 Build/JVP15I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
                  },*/
                  onload : function (result) {
                    var res = result.responseText;
                    Aak.log(res);
                    var o = JSON.parse(res);
                    var videoUrl = o.item.videos.main.video_content[Number(Aak.opts.videoHD)].url;
                    // var generateToken = new Function('videoUrl', Aak.getSession('generateToken'));
                    // var videoUrlWithSeed = generateToken(videoUrl);
                    var Player = new Aak.player();
                    Player.videojs(thisElement, {
                      source : videoUrl,
                      type : 'mp4',
                      autoplay: false
                    }, {}, {insert:'inner'});
                  }
                });
            /* } else {
              Aak.request({ // get and store generateToken function
                url : 'http://pastebin.com/raw/D9qM4DR3',
                onload : function (response) {
                  var res = response.responseText;
                  Aak.setSession('generateToken', res);
                  Aak.request({ // get user ip
                    url : 'http://ip-api.com/json',
                    onload : function (response) {
                      var res = response.responseText;
                      var json = JSON.parse(res);
                      Aak.setCookie('country_code', json.countryCode);
                      Aak.refresh();
                    }
                  });
                }
              });
             } */
          });
        }
      }
jspenguin2017 commented 7 years ago

@F4z OK, I added it. Try 6.36 and let me know how it goes.

Update: 6.37 fixed player being too wide.

F4z commented 7 years ago

@X01X012013 ok, thank you. I checked 6.37 version and in most cases it works, but for some reason it does not work here - http://player.pl/seriale-online/belle-epoque-odcinki,5019/odcinek-1,S00E01,69751.html?atpl#play

and here the player is too big, I think - http://player.pl/programy-online/agent-gwiazdy-odcinki,4305/odcinek-2,S02E02,69914.html?pl_campaign=agent_gwiazdy&pl_source=driver_2&atpl#play

image

jspenguin2017 commented 7 years ago

@F4z

  1. File type isn't supported natively, hum... I'll have another look.
  2. Added height cap, fixed in 6.40.
jspenguin2017 commented 7 years ago

@F4z

Looks like it's WideVine DRM Protected Video, unfortunately, patching their player for this isn't an option.

Did you guys figure out what AdGuard did? We can still use their solution. Update: wait, what the heck, AdGuard isn't free?! Well, if it's proprietary then we might not be able to just take their solution...

Anyone has a Pi Hole server maybe we can see if that works...

F4z commented 7 years ago

@X01X012013 if I understand correctly, they use rule with $empty modifier for requests which load ads (VAST).

For example - http://tvn.adocean.pl/__/ad.xml?aocodetype=1/predur=240/postdur=300/mid1dur=240/mid2dur=240/mid3dur=240/overdur=2000/tvn_vod_trailer=0/catchup_no_fee=0/midcnt=1/tvn_vod_serie=milionerzy/tvn_vod_season=0/tvn_vod_prepremiere=0/tvn_vod_episode=7/tvn_vod_wonid=JKV-17-001,17_400_22545_0007/tvn_vod_category=200,201/tvn_vod_traffic_category=kobieta,mezczyzna/tvn_collection=320/tvn_price=no/tvn_player_type=kinowy_player5,360/id=zeOb3_LRSL3Bnfg15ylC7tH60MVPXMMAN8DTNtpnaE3.V7/tvn_vod_embed=0/tvn_terminal=24/tvn_page=programy_online_milionerzy_odcinki_5045_odcinek_7_s00e07_70552_html/tvn_login=no/tvn_driver=1/tvn_device_type=Desktop/x=1920/y=1080/w=1920/h=950/tvn_player_size=960

xxcriticxx commented 7 years ago

@X01X012013 i have pihole server but no polish ip

jspenguin2017 commented 7 years ago

emulate a blank response This sounds like uBlock Origin's redirect... Can you try this rule on uBlock Origin? I'm Geo Locked. ||adocean.pl/*ad.xml$domain=player.pl,redirect=nooptext,important

F4z commented 7 years ago

I tried this, but it does not work - https://github.com/MajkiIT/polish-ads-filter/issues/2022#issuecomment-278401455

jspenguin2017 commented 7 years ago

Well, if someone figured it out, let me know. There isn't much I can do here being Geo Locked.

On the bright side... @xxcriticxx You said you want komputerswiat.pl videos to stop auto-playing, right? I think I can make it possible 😄

xxcriticxx commented 7 years ago

If it would be me I would stop all video all websites

What you need pihole server for?

jspenguin2017 commented 7 years ago

@xxcriticxx Just wondering if it would do the same trick as AdGuard... Every website is different, the same anti-autoplay mechanism won't work for all...

xxcriticxx commented 7 years ago

Yes but not until @MajkiIT gets a polish proxy setup going

jspenguin2017 commented 7 years ago

@xxcriticxx Is it safe to assume that there will only be 1 video per page on komputerswiat.pl?

xxcriticxx commented 7 years ago

@X01X012013 you have to ask expert and that's @szymon1118 Can you have a look please?

jspenguin2017 commented 7 years ago

Well, it tries HARD to autoplay... image

I now assume that there is only one video per page (or only the first one will be patched). Let me know if there is a page that has more.

xxcriticxx commented 7 years ago

Ok boys sleep time have good night all

jspenguin2017 commented 7 years ago

@xxcriticxx Added to 6.41. The settings page toggle will be a disable autoplay "master switch".

MajkiIT commented 7 years ago

@X01X012013 Can you use one of this proxy? http://free-proxy.cz/en/proxylist/country/PL/all/speed/level1 ? Unfortunately my VPS is not GeoLocated in Poland. If this proxy list will be bad I will find new solution.

MajkiIT commented 7 years ago

on this video http://player.pl/seriale-online/belle-epoque-odcinki,5019/odcinek-1,S00E01,69751.html?atpl#play I see geolock, but I'm in Poland.

mathew85 commented 7 years ago

I also added new issue to uBlock Origin about that empty modifier, but no response yet. uBlockOrigin/uAssets#293

szymon1118 commented 7 years ago

@X01X012013 As you mentioned before some videos are DRM protected and there are nothing we can do with this now (I can only access to .wvm file: http://www.proxy.xmc.pl/index.php?hl=3e5&q=https%3A%2F%2Fapi.tvnplayer.pl%2Fapi%2F%3Fplatform%3DConnectedTV%26terminal%3DPanasonic%26format%3Djson%26authKey%3D064fda5ab26dc1dd936f5c6e84b7d3c2%26v%3D3.1%26m%3DgetItem%26protected%3D1%26id%3D69751). We can also keep looking for commits here: http://svn.sd-xbmc.org/log.php?repname=sd-xbmc&path=%2Ftrunk%2Fxbmc-addons%2Fsrc%2Fplugin.video.polishtv.live%2Fhosts%2Ftvn.py because people from here are always first in finding a video grabbing method. Someone on forum posted that player.pl use same DRM as Netflix and others so it is nearly impossible to break it.

jspenguin2017 commented 7 years ago

@szymon1118 Well, in this case, we'll just keep things as is for now, non-DRM videos will be patched, and DRM videos will be untouched and you probably have to watch some ads to watch whose protected videos.

szymon1118 commented 7 years ago

@MajkiIT @F4z @xxcriticxx Znalazłem tutaj (http://miniskrypt.hubaiitv.pl/thread-54-post-568.html#pid568) instrukcję, jak sniffować ruch z playera (ja użyłem androida, bo Smart TV nie mam). Udało mi się wydobyć nowe api, ale jak wklejałem link do przeglądarki, to był błąd, że ten parametr ticket jest przedawniony i nie wiem teraz, czy on się jakoś dynamicznie zmienia, bo po requestach na to nie wyglądało (link: http://api.tvnplayer.pl/api/?v=3.7&m=prepareVideoContentPlayList&format=json&platform=Mobile&terminal=Android&id=69752&authKey=4dc7b4f711fb9f3d53919ef94c23890c&ticket=058b9857cfc578f77184908b26f2450b0000000000), może ktoś to rozgryzie. Jeśli chodzi o filmy 360, o których wspominał @F4z, to wydaje mi się, że ich jest w playerze na tyle mało, że nie używają API do nich, więc chyba jedyna możliwość, to po prostu je pobrać (link: http://redir.atmcdn.pl/http/o2/tvnplayer/vod/16_400_23517_0001/MP4_360/9839b70e-b66e-4f9e-b7c2-04abae7cb3bc/2528000.mp4). Jak ktoś z was ma Smart TV i trochę czasu, to możecie spróbować, może czegoś więcej się dowiemy :smile:.

xxcriticxx commented 7 years ago

@szymon1118 tv samsung mam gozej z reszta

jspenguin2017 commented 7 years ago

No clue what you said... if there is something I need to know, please write in English...

xxcriticxx commented 7 years ago

@X01X012013

@szymon1118 has found way using info on the forum how to sniff traffic from player.pl. he found the api but the ticket part has expired. so we looking for someone with samsung smart tv to sniff some more of the traffic to see what we can get.

szymon1118 commented 7 years ago

@X01X012013 Also @F4z mentioned about 360 degree videos and I found that they are not using API for them (probably because there are only few videos). I was only able to sniff direct link to them. Here is sample link: http://redir.atmcdn.pl/http/o2/tvnplayer/vod/16_400_23517_0001/MP4_360/9839b70e-b66e-4f9e-b7c2-04abae7cb3bc/2528000.mp4

jspenguin2017 commented 7 years ago

Well... We would need a player that can handle this... image

szymon1118 commented 7 years ago

@X01X012013 Probably yes but now we don't even know how to find a link to video other than by sniffing. Unfortunately they don't use their API for 360 degree videos.

xxcriticxx commented 7 years ago

@szymon1118 where do i find player.pl app for samsung tv?

github-actions[bot] commented 1 day ago

Ten wątek został automatycznie zablokowany, ponieważ 60 dni po jego zamknięciu nie było żadnej aktywności. Proszę otworzyć nowe zgłoszenie dla powiązanych problemów.