Git Product home page Git Product logo

Comments (9)

 avatar commented on June 14, 2024

Can you give me a sample file? I will write a function to import those settings.

from blocktube.

jayadevanraja avatar jayadevanraja commented on June 14, 2024

Thanks for responding.

Video Blocker (3081 keys 5-4-2019 part 8 of 8).json.txt

Hopefully I have attached correctly. Github is not allowing ".json" files. So, I have renamed it to ".json.txt"

It is basically a file of key-value pairs, where key is the name of the channel to be blocked (and the value is "channel"), or the keyword to be blocked (and the value is "keyword"). Wildcards are also accepted.

Settings from multiple such files is accepted. The data is added to the current settings (current settings are not replaced).

from blocktube.

 avatar commented on June 14, 2024

I am wondering where should the keyword type go? We can create an import setting that would block all the channels given in the import and specify the format of the json.
I think this would be a question for the author -> What should be the standard format of the json?
type: [channels, channel_id, video_id, video] and there would be a corresponding key.
Something like this.... The 'keyword' type should be manually replaced with video title to keep it generic.

{"key":"പാഞ്ചജന്യം","type":"channel"},{"key":"Cinema Company","type":"channel"},{"key":"Asia Live TV","type":"channel"},{"key":"Scene Contra","type":"channel"},{"key":"മമ്മൂട്ടി","type":"keyword"}

from blocktube.

 avatar commented on June 14, 2024

Sorry, I noticed there is already an import feature. I think the best idea would be to read the json that you have and save it in a different format. Then import that json

from blocktube.

jayadevanraja avatar jayadevanraja commented on June 14, 2024

From the above comments I have a few questions:
(1) What is the import Json format expected by Blocktube? Probably a python script can convert between the formats.
(2) I am sorry that I didn't understand what the meaning is when you said "The 'keyword' type should be manually replaced with video title". What that setting does is that, if the title contains the corresponding keyword (inside the title), it will be blocked.

It will be more user-friendly if this extension is able to import the settings (and internally change the JSON format, as needed), so that switching between the extensions is easy. I am thinking of switching to the FOSS extension Blocktube, since "Video Blocker" is too resource hungry and proprietary.

from blocktube.

amitbl avatar amitbl commented on June 14, 2024

@shivamriky @Jayadevan-Vijayan

This is the format the extension expects to receive with the import option

{"filterData":{"channelId":["UC295-Dw_tDNtZXFeAPAW6Aw"],"channelName":["KeywordInChannelNameToBlock"],"comment":["KeywordInCommentToBlock"],"title":["KeywordInTitleToBlock"],"vidLength":[22,3333],"videoId":["hTIQz633_9w"]},"options":{"autoplay":true,"block_message":"Blocked","mixes":true,"trending":true},"uiPass":"111"}

I don't have much free time atm to continue developing new features for this extension, I only do bugfixes for now, but I will accept a pull requests that will improve it like adding support for importing "Video blocker" backups

from blocktube.

jayadevanraja avatar jayadevanraja commented on June 14, 2024

Thanks. I don't know what the etiquette of github is, so I don't know whether this issue should be left open or closed. Thanks for the response. :)

from blocktube.

 avatar commented on June 14, 2024

@amitbl
Could you help me to understand how are you filtering the content using the js?
What I have understood so far is that you are trying to filter out the content using SPF filters which will probably either prevent the response from being displayed on the webpage. I am not sure exactly how all of this is happening.
If you can name the technologies I need to understand that would be great.

Regards,
Shivam Rastogi

from blocktube.

amitbl avatar amitbl commented on June 14, 2024

spfjs is what youtube's using to execute XHR requests (https://github.com/youtube/spfjs)
But You don't need to know it or any other special technologies, only basic vanilla Javascript.

The addon at it's core is very basic and consists pretty much of two stages

  • Registering a function hook for spfjs, this allows to modify JSON received from youtube servers before it actually hit any another youtube js code.
  • In that function hook, recursively parse received responses and filter out results defined by the user

Here are the functions to start from:

Registering hook for spfjs:

Implementation of the hooking function

Recursive object filtering function

from blocktube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.